d4177e6e33
### Description of Changes this was not passing back the correct path for the dockerfile
15 lines
625 B
Python
15 lines
625 B
Python
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_context'}, 'some_context/Dockerfile', 'some_context'),
|
|
({'subdirectory': 'some_context/'}, 'some_context/Dockerfile', 'some_context/'),
|
|
])
|
|
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
|