diff options
author | shabs2020 <shabnam.sultana@highstreet-technologies.com> | 2021-02-19 15:50:17 +0100 |
---|---|---|
committer | shabs2020 <shabnam.sultana@highstreet-technologies.com> | 2021-02-22 16:55:25 +0100 |
commit | 93da1351f5a8e870735f507a74147560c827b179 (patch) | |
tree | c58b5abdfe5ce9b30e9d2ba07a06cea63845d393 /adapter/acumos/tests/test_docker.py | |
parent | 1eded3b8420e0c1c72e48f00f18399b7d2142118 (diff) |
Improve code coverage of Acumos-DCAE adapter1.0.4-adapter-acumos
Adding and modifying unit test scripts to increase code coverage of the Acumos-DCAE adapter
Issue-ID: DCAEGEN2-2633
Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com>
Change-Id: I22e752d8ce33373b3326757594445e0288874b35
Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com>
Diffstat (limited to 'adapter/acumos/tests/test_docker.py')
-rw-r--r-- | adapter/acumos/tests/test_docker.py | 12 |
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') |