mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-24 07:18:27 +01:00
Add a test for it
This commit is contained in:
+15
-1
@@ -71,7 +71,7 @@ class TestCheckoutCorruptedCacheFile(TestRepro):
|
||||
class TestCheckoutCorruptedCacheDir(TestDvc):
|
||||
def test(self):
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
# NOTE: using 'copy' so that cache and link don't have same inode
|
||||
ret = main(['config', 'cache.type', 'copy'])
|
||||
self.assertEqual(ret, 0)
|
||||
@@ -159,6 +159,20 @@ class TestRemoveFilesWhenCheckout(CheckoutBase):
|
||||
self.assertFalse(os.path.exists(fname))
|
||||
|
||||
|
||||
class TestCheckoutCleanWorkingDir(CheckoutBase):
|
||||
def test(self):
|
||||
stages = self.dvc.add(self.DATA_DIR)
|
||||
stage = stages[0]
|
||||
|
||||
working_dir_change = os.path.join(self.DATA_DIR, 'not_cached.txt')
|
||||
with open(working_dir_change, 'w') as f:
|
||||
f.write('not_cached')
|
||||
|
||||
ret = main(['checkout', stage.relpath])
|
||||
self.assertEqual(ret, 0)
|
||||
self.assertFalse(os.path.exists(working_dir_change))
|
||||
|
||||
|
||||
class TestCheckoutSelectiveRemove(CheckoutBase):
|
||||
def test(self):
|
||||
# Use copy to test for changes in the inodes
|
||||
|
||||
Reference in New Issue
Block a user