Exemplo n.º 1
0
 def test_find_ffile(self, filelist):
     assert PathHelper.find_first_dir_with_file(
         "dir1", "*le") == os.path.abspath(os.path.dirname(filelist[9]))
     assert PathHelper.find_first_dir_with_file(
         "dir1", "ff*") == os.path.abspath(os.path.dirname(filelist[8]))
     assert PathHelper.find_first_dir_with_file("dir1/foo",
                                                "ff*") is None
Exemplo n.º 2
0
 def test_find_pythoon(self):
     assert PathHelper.find_first_dir_with_file("dir1", "pythooon") == os.path.abspath(
         os.path.dirname(self.files[4])
     )
     assert PathHelper.find_first_dir_with_file(os.path.curdir, "py*n") == os.path.abspath(
         os.path.dirname(self.files[4])
     )
     assert PathHelper.find_first_dir_with_file("dir1/bar", "pythooon") is None
Exemplo n.º 3
0
 def test_find_file(self):
     assert PathHelper.find_first_dir_with_file("dir1", "file") == os.path.abspath(
         os.path.dirname(self.files[9])
     )
     assert PathHelper.find_first_dir_with_file(os.path.curdir, "file") == os.path.abspath(
         os.path.dirname(self.files[0])
     )
     assert PathHelper.find_first_dir_with_file("dir1/baz", "file") is None
Exemplo n.º 4
0
 def test_find_pythoon(self, filelist):
     assert PathHelper.find_first_dir_with_file(
         "dir1", "pythooon") == os.path.abspath(
         os.path.dirname(filelist[4]))
     assert PathHelper.find_first_dir_with_file(
         os.path.curdir, "py*n") == os.path.abspath(os.path.dirname(filelist[4]))
     assert PathHelper.find_first_dir_with_file(
         "dir1/bar", "pythooon") is None
Exemplo n.º 5
0
 def test_find_file(self, filelist):
     assert PathHelper.find_first_dir_with_file(
         "dir1", "file") == os.path.abspath(
         os.path.dirname(filelist[9]))
     assert PathHelper.find_first_dir_with_file(
         os.path.curdir, "file") == os.path.abspath(os.path.dirname(filelist[0]))
     assert PathHelper.find_first_dir_with_file(
         "dir1/baz", "file") is None
Exemplo n.º 6
0
 def test_find_ffile(self):
     assert PathHelper.find_first_dir_with_file(
         "dir1", "*le") == os.path.abspath(
         os.path.dirname(self.files[9]))
     assert PathHelper.find_first_dir_with_file(
         "dir1", "ff*") == os.path.abspath(
         os.path.dirname(self.files[8]))
     assert PathHelper.find_first_dir_with_file(
         "dir1/foo", "ff*") is None