From 9c5f5aefb0cef222c2b70cc44fe805130461a343 Mon Sep 17 00:00:00 2001 From: FemtosecondLaser <38204088+FemtosecondLaser@users.noreply.github.com> Date: Thu, 21 Oct 2021 00:27:31 +0100 Subject: [PATCH] removed redundant tests renamed a test to be more specific about the kind of the precondition --- tests/unit/test_cli.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 2f9b7219c..3fa6550c5 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -211,22 +211,11 @@ class DirectoryTests(FakeFSTestCase): def setUp(self): self.setUpPyfakefs() - def test_when_dir_does_not_exist_then_it_is_created(self): - dir_path = "dir" - ensure_directory_exists(dir_path) - self.assertTrue(os.path.exists(dir_path)) - def test_when_parent_dir_does_not_exist_then_dir_is_created_with_parent(self): dir_path = os.path.join("parent_dir", "dir") ensure_directory_exists(dir_path) self.assertTrue(os.path.exists(dir_path)) - def test_when_dir_exists_then_it_still_exists(self): - dir_path = "dir" - pathlib.Path(dir_path).mkdir() - ensure_directory_exists(dir_path) - self.assertTrue(os.path.exists(dir_path)) - def test_when_non_writable_dir_exists_then_raise(self): dir_path = "dir" pathlib.Path(dir_path).mkdir(mode=0o555) # creates a non-writable, readable and executable dir @@ -241,7 +230,7 @@ class DirectoryTests(FakeFSTestCase): except (FileExistsError, PermissionError) as err: self.fail(f"{type(err).__name__} was raised") - def test_when_file_exists_at_path_then_raise(self): + def test_when_non_dir_file_exists_at_path_then_raise(self): file_path = "file.extension" self.fs.create_file(file_path) with self.assertRaises(FileExistsError):