aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/tests
diff options
context:
space:
mode:
Diffstat (limited to 'onap-client/onap_client/tests')
-rw-r--r--onap-client/onap_client/tests/test_resource.py20
-rw-r--r--onap-client/onap_client/tests/testdata.py8
2 files changed, 8 insertions, 20 deletions
diff --git a/onap-client/onap_client/tests/test_resource.py b/onap-client/onap_client/tests/test_resource.py
index 5b4124a..6f7a014 100644
--- a/onap-client/onap_client/tests/test_resource.py
+++ b/onap-client/onap_client/tests/test_resource.py
@@ -34,20 +34,16 @@
# limitations under the License.
#
# ============LICENSE_END============================================
-
from onap_client.resource import Resource
-from onap_client.lib import generate_dummy_string, generate_dummy_date
class TestResource(Resource):
- def __init__(self, test_param):
- test_input = {}
-
- test_input["param1"] = test_param
- test_input["param2"] = generate_dummy_string()
- test_input["param3"] = generate_dummy_date()
-
- super().__init__(test_input)
+ spec = {
+ "param1": {
+ "type": str,
+ "required": True,
+ },
+ }
def _create(self, create_input):
return create_input
@@ -62,7 +58,7 @@ class TestResource(Resource):
def test_resource():
test_param = "abc"
- r = TestResource(test_param)
- r.print()
+ r = TestResource(param1=test_param)
+ r.create()
assert hasattr(r, "param1") and r.param1 == test_param
diff --git a/onap-client/onap_client/tests/testdata.py b/onap-client/onap_client/tests/testdata.py
index c5cb235..14f15c7 100644
--- a/onap-client/onap_client/tests/testdata.py
+++ b/onap-client/onap_client/tests/testdata.py
@@ -70,14 +70,6 @@ class TestResource(Resource):
},
}
- def __init__(self, test1, test2):
- instance_input = {}
-
- instance_input["test1"] = test1
- instance_input["test2"] = test2
-
- super().__init__(instance_input)
-
def _create(self, instance_input):
print("creating test instance {}".format(instance_input))