def test_not_even_creating_parents(self): path = self.useFixture(TempDir()).path make_tree(path, ['a/b/foo.txt', 'c/d/e/']) self.assertThat( os.path.join(path, 'a', 'b', 'foo.txt'), FileContains("The file 'a/b/foo.txt'.")) self.assertThat(os.path.join(path, 'c', 'd', 'e'), DirExists())
def test_out_of_order(self): # If a file or a subdirectory is listed before its parent directory, # that doesn't matter. We'll create the directory first. path = self.useFixture(TempDir()).path make_tree(path, ['a/b/', 'a/']) self.assertThat(path, DirContains(['a'])) self.assertThat(os.path.join(path, 'a'), DirContains(['b'])) self.assertThat(os.path.join(path, 'a', 'b'), DirExists())
def test_not_even_creating_parents(self): path = self.useFixture(TempDir()).path make_tree(path, ['a/b/foo.txt', 'c/d/e/']) self.assertThat(os.path.join(path, 'a', 'b', 'foo.txt'), FileContains("The file 'a/b/foo.txt'.")) self.assertThat(os.path.join(path, 'c', 'd', 'e'), DirExists())