diff options
author | Vijay Venkatesh Kumar <vv770d@att.com> | 2020-08-03 18:15:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-03 18:15:21 +0000 |
commit | ba3d7306c1773ea78ad7a87468fc66b9b4f18551 (patch) | |
tree | bd39a59806e9772d6b597b0e0db48d5b9035fcbf /mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py | |
parent | 9f7c742ea64a6acb4f5ce2b8df885750c68a2ed3 (diff) | |
parent | 711d4eae913f34e78aa10e8cd511f3b8e43cd54f (diff) |
Merge "Pull JSON schemas at build/test not run time"
Diffstat (limited to 'mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py')
-rw-r--r-- | mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py b/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py index 90674d9..9270268 100644 --- a/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py +++ b/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -394,6 +394,8 @@ def test_validate(): good_path = "/correct_path" + goodschema = schema._Schema(good_path) + goodschema.ret = fake_schema def fetch_schema(path): if path == good_path: return fake_schema @@ -404,18 +406,20 @@ def test_validate(): good_instance = { "foo": "hello", "bar": 1776 } - schema._validate(fetch_schema, good_path, good_instance) + schema._validate(goodschema, good_instance) # Error from validating bad_instance = {} with pytest.raises(DcaeException): - schema._validate(fetch_schema, good_path, bad_instance) + schema._validate(goodschema, bad_instance) # Error from fetching bad_path = "/wrong_path" + badschema = schema._Schema(bad_path) + with pytest.raises(DcaeException): - schema._validate(fetch_schema, bad_path, good_instance) + schema._validate(badschema, good_instance) |