dvc: add confirmation for dvc destroy

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-15 19:18:01 +03:00
committed by Ruslan Kuprieiev
parent 586fde5f95
commit fef8ea4602
4 changed files with 56 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import os
from dvc.main import main
from tests.test_repro import TestRepro
class TestDestroyNoConfirmation(TestRepro):
def test(self):
ret = main(['destroy'])
self.assertNotEqual(ret, 0)
class TestDestroyForce(TestRepro):
def test(self):
ret = main(['destroy', '-f'])
self.assertEqual(ret, 0)
self.assertFalse(os.path.exists(self.dvc.dvc_dir))
self.assertFalse(os.path.exists(self.file1_stage))
self.assertFalse(os.path.exists(self.file1))