Beispiel #1
0
    def test_transform_next_dir_level_no_directories(self, mock_build_tree):
        path = "wintersun/posts"
        directories = []

        wintersun.transform_next_dir_level(path, directories)

        self.assertFalse(mock_build_tree.called)
Beispiel #2
0
    def test_transform_next_dir_level(self, mock_build_tree, mock_mkdir):
        path = "wintersun/posts"
        directories = ["dir1", "dir2"]
        expected_path = wintersun.TARGET_DIR = "/" + path

        wintersun.transform_next_dir_level(path, directories)

        mock_mkdir.assert_has_call([mock.call(expected_path + "/dir1"), mock.call(expected_path + "/dir2")])
        self.assertTrue(mock_build_tree.called)
Beispiel #3
0
    def test_transform_next_dir_level_excluded_dirs(self, mock_build_tree):
        path = "wintersun/posts"

        wintersun.transform_next_dir_level(path, wintersun.EXCLUDED_DIRS)
        self.assertFalse(mock_build_tree.called)