Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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
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
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
def _find_makefile(self):
logger.debug(
"Sources: Looking for Makefile in {0}".format(self.get_path()))
return PathHelper.find_first_dir_with_file(self.get_path(), "Makefile")