def test_input_paths_recurse(self): input_paths = [] for root, _, files in os.walk(self.test_dir): root = os.path.relpath(root) input_paths.extend(os.path.join(root,f) for f in files) expected = set(input_paths) self.assertSetEqual(expected, set(list(dianonymous.get_input_paths(self.test_dir, True))))
def test_input_paths_recurse(self): input_paths = [] for root, _, files in os.walk(self.test_dir): root = os.path.relpath(root) input_paths.extend(os.path.join(root, f) for f in files) expected = set(input_paths) self.assertSetEqual( expected, set(list(dianonymous.get_input_paths(self.test_dir, True))))
def test_input_paths_no_recurse(self): input_paths = os.listdir(self.test_dir) expected = set([i for i in input_paths if not os.path.isdir(i)]) self.assertSetEqual( expected, set(dianonymous.get_input_paths(input_paths, False)))
def test_input_paths_no_recurse(self): input_paths = os.listdir(self.test_dir) expected = set([i for i in input_paths if not os.path.isdir(i)]) self.assertSetEqual(expected, set(dianonymous.get_input_paths(input_paths, False)))