How to use the yoga.model.helpers.find_valid_path function in yoga

To help you get started, we’ve selected a few yoga examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wanadev / yoga / test / test_model_helpers.py View on Github external
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
github wanadev / yoga / test / test_model_helpers.py View on Github external
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
github wanadev / yoga / test / test_model_helpers.py View on Github external
"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
github wanadev / yoga / test / test_model_helpers.py View on Github external
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
github wanadev / yoga / test / test_model_helpers.py View on Github external
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
github wanadev / yoga / test / test_model_helpers.py View on Github external
"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