This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/endpoints/api/test/test_build.py

15 lines
542 B
Python
Raw Normal View History

import pytest
from endpoints.api.build import RepositoryBuildList
@pytest.mark.parametrize('request_json,subdir,context', [
({}, "/Dockerfile", "/"),
({"context": "/some_context"}, "/some_context/Dockerfile", "/some_context"),
({"subdirectory": "/some_subdir/Dockerfile"}, "/some_subdir/Dockerfile", "/"),
])
def test_extract_dockerfile_args(request_json, subdir, context):
actual_context, actual_subdir = RepositoryBuildList.get_dockerfile_context(request_json)
assert subdir == actual_subdir
assert context == actual_context