From e2f39a522a45e777b80bca895028a8f21549e8b8 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 2 May 2017 23:12:57 -0700 Subject: [PATCH] Fix unit tests --- tests/test_cmd_data_remove.py | 10 +++++----- tests/test_config.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_cmd_data_remove.py b/tests/test_cmd_data_remove.py index 1827523a8..eee2fd233 100644 --- a/tests/test_cmd_data_remove.py +++ b/tests/test_cmd_data_remove.py @@ -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)) diff --git a/tests/test_config.py b/tests/test_config.py index 6e5ce1749..73d9dc51d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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')