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_valid_path(self):
paths = dict({
"images/texture.png": True,
"images/texture.jpg": True,
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None
def test_find_valid_path(self):
paths = dict({
"images/texture.png": True,
"images/texture.jpg": True,
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None
def test_find_valid_path(self):
paths = dict({
"images/texture.png": True,
"images/texture.jpg": True,
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None
def test_find_valid_path(self):
paths = dict({
"images/texture.png": True,
"images/texture.jpg": True,
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None
"images/texture.png": True,
"images/texture.jpg": True,
"other_images/texture.jpg": True,
"texture.gif": True,
})
assert helpers.find_valid_path(
"images/texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"images/texture.jpg", paths) == "images/texture.jpg"
assert helpers.find_valid_path(
"texture.png", paths) == "images/texture.png"
assert helpers.find_valid_path(
"texture.jpg", paths) is None
assert helpers.find_valid_path(
"non-existing.png", paths) is None
assert helpers.find_valid_path(
"exture.png", paths) is None