e8c4cc49bd
forgot to add this Issue: https://www.pivotaltracker.com/story/show/144661631 - [ ] It works! - [ ] Comments provide sufficient explanations for the next contributor - [ ] Tests cover changes and corner cases - [ ] Follows Quay syntax patterns and format
22 lines
598 B
Python
22 lines
598 B
Python
import pytest
|
|
|
|
from endpoints.api.trigger_analyzer import is_parent
|
|
|
|
|
|
@pytest.mark.parametrize('context,dockerfile_path,expected', [
|
|
("/", "/a/b", True),
|
|
("/a", "/a/b", True),
|
|
("/a/b", "/a/b", False),
|
|
("/a//", "/a/b", True),
|
|
("/a", "/a//b/c", True),
|
|
("/a//", "a/b", True),
|
|
("/a/b", "a/bc/d", False),
|
|
("/d", "/a/b", False),
|
|
("/a/b", "/a/b.c", False),
|
|
("/a/b", "/a/b/b.c", True),
|
|
("", "/a/b.c", False),
|
|
("/a/b", "", False),
|
|
("", "", False),
|
|
])
|
|
def test_super_user_build_endpoints(context, dockerfile_path, expected):
|
|
assert is_parent(context, dockerfile_path) == expected
|