Esempio n. 1
0
 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//'))
Esempio n. 2
0
def test_empty_and_recursive(few_files):
    assert set(process_path([], recursive=True)) == {
        "first.po",
        "second.po",
        "library/lib1.po",
        "venv/file1.po",
    }
Esempio n. 3
0
 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))
Esempio n. 4
0
 def test_list_of_files(self):
     self.assertSequenceEqual(['file1.txt', 'file2.txt'],
                              process_path(['file1.txt', 'file2.txt'],
                                           recursive=False,
                                           exclude_dir=None))
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
def test_list_of_files(few_files):
    assert set(process_path(["file1.txt", "file2.txt"], recursive=False)) == {
        "file1.txt",
        "file2.txt",
    }
Esempio n. 8
0
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
Esempio n. 9
0
def test_directory_and_no_recursion(few_files):
    with pytest.raises(SystemExit) as excinfo:
        process_path(".", recursive=False)
    assert excinfo.value.code == 1