Fix unit tests

This commit is contained in:
Dmitry Petrov
2017-05-02 23:12:57 -07:00
parent 1cc813027f
commit e2f39a522a
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -1,6 +1,7 @@
import os
from dvc.command.remove import CmdDataRemove, DataRemoveError
from dvc.path.data_item import DataItemError
from tests.basic_env import DirHierarchyEnvironment
@@ -94,8 +95,9 @@ class TestRemoveDataItem(DirHierarchyEnvironment):
self.assertTrue(os.path.exists(self.state6))
self.assertTrue(os.path.isfile(self.state6))
cmd.remove_file(self.file6)
self.assertFalse(os.path.exists(self.file6))
with self.assertRaises(DataItemError):
cmd.remove_file(self.file6)
self.assertTrue(os.path.exists(self.file6))
class TestRemoveEndToEnd(DirHierarchyEnvironment):
@@ -188,9 +190,8 @@ class TestRemoveEndToEndWithAnError(DirHierarchyEnvironment):
dir11_full = os.path.join(self._config.data_dir, self.dir11)
dir2_full = os.path.join(self._config.data_dir, self.dir2)
file6_full = self.file6
cmd.parsed_args.target = [dir11_full, self.file5, file6_full]
cmd.parsed_args.target = [dir11_full, self.file5]
cmd.parsed_args.recursive = True
cmd.parsed_args.no_git_actions = True
@@ -207,4 +208,3 @@ class TestRemoveEndToEndWithAnError(DirHierarchyEnvironment):
self.assertFalse(os.path.exists(self.file5))
self.assertTrue(os.path.exists(dir2_full))
self.assertTrue(os.path.exists(self.file1))
self.assertFalse(os.path.exists(self.file6))
+2 -2
View File
@@ -44,7 +44,7 @@ class TestConfigTest(TestCase):
"DataDir = ",
"CacheDir = ",
"StateDir = ",
"Cloud = amazon",
"Cloud = Aws",
"[AWS]",
"StoragePath = awssb/aws_storage_path",
"CredentialPath =",
@@ -54,7 +54,7 @@ class TestConfigTest(TestCase):
s = StringIO.StringIO('\n'.join(c))
conf = Config(s, conf_pseudo_file=s)
self.assertEqual(conf.cloud, 'amazon')
self.assertEqual(conf.cloud, 'aws')
self.assertEqual(conf.storage_bucket, 'awssb')
self.assertEqual(conf.storage_prefix, 'aws_storage_path')