summaryrefslogtreecommitdiffstats
path: root/adapter/acumos/tests/test_docker.py
diff options
context:
space:
mode:
Diffstat (limited to 'adapter/acumos/tests/test_docker.py')
-rw-r--r--adapter/acumos/tests/test_docker.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/adapter/acumos/tests/test_docker.py b/adapter/acumos/tests/test_docker.py
index 0d84038..2f618e6 100644
--- a/adapter/acumos/tests/test_docker.py
+++ b/adapter/acumos/tests/test_docker.py
@@ -16,8 +16,9 @@
# limitations under the License.
# ============LICENSE_END======================================================
-from testing_helpers import get_json_fixture
-from aoconversion import docker_gen
+from testing_helpers import get_json_fixture, get_fixture_path
+from aoconversion import docker_gen, scanner
+import test_fed
TEST_META = get_json_fixture("models/example-model/metadata.json")
@@ -45,3 +46,10 @@ def test_generate_dockerfile():
CMD ["/app/example-model"]
"""
)
+
+
+def test_build_and_push_docker(monkeypatch):
+ model_repo_path = get_fixture_path('models')
+ config = scanner.Config(dcaeurl='http://dcaeurl', dcaeuser='dcaeuser', onboardingurl='https://onboarding', onboardinguser='obuser', onboardingpass='obpass', acumosurl='https://acumos', certfile=None, dockerregistry='dockerregistry', dockeruser='registryuser', dockerpass='registrypassword', tmpdir=model_repo_path)
+ monkeypatch.setattr(docker_gen, 'APIClient', test_fed._mockdocker.APIClient)
+ assert(docker_gen.build_and_push_docker(config, 'example-model', model_version="latest") == 'dockerregistry/example-model:latest')