def test_exclude_dir(self): self.assertSequenceEqual(['first.po', 'second.po', 'library/lib1.po'], process_path([], recursive=True, exclude_dir='venv')) self.assertSequenceEqual(['first.po', 'second.po', 'library/lib1.po'], process_path([], recursive=True, exclude_dir='venv/')) self.assertSequenceEqual(['first.po', 'second.po', 'library/lib1.po'], process_path([], recursive=True, exclude_dir='venv//'))
def test_empty_and_recursive(few_files): assert set(process_path([], recursive=True)) == { "first.po", "second.po", "library/lib1.po", "venv/file1.po", }
def test_empty_and_recursive(self): self.assertSequenceEqual( ['first.po', 'second.po', 'library/lib1.po', 'venv/file1.po'], process_path([], recursive=True, exclude_dir=None))
def test_list_of_files(self): self.assertSequenceEqual(['file1.txt', 'file2.txt'], process_path(['file1.txt', 'file2.txt'], recursive=False, exclude_dir=None))
def test_no_file(self): with self.assertRaises(SystemExit) as cm: process_path('non_exists_file.po', recursive=False, exclude_dir=None) self.assertEqual(cm.exception.code, 1)
def test_directory_and_no_recursion(self): with self.assertRaises(SystemExit) as cm: process_path('.', recursive=False, exclude_dir=None) self.assertEqual(cm.exception.code, 1)
def test_list_of_files(few_files): assert set(process_path(["file1.txt", "file2.txt"], recursive=False)) == { "file1.txt", "file2.txt", }
def test_no_file(few_files): with pytest.raises(SystemExit) as excinfo: process_path("non_exists_file.po", recursive=False) assert excinfo.value.code == 1
def test_directory_and_no_recursion(few_files): with pytest.raises(SystemExit) as excinfo: process_path(".", recursive=False) assert excinfo.value.code == 1