diff options
author | laili <lai.li@zte.com.cn> | 2018-08-24 19:59:33 +0800 |
---|---|---|
committer | laili <lai.li@zte.com.cn> | 2018-08-27 09:34:52 +0800 |
commit | f4a7f60d7c14934c599bb5412434157461b096e2 (patch) | |
tree | 987f9b45d3e098e1f8fa9fcb1593d9ad3650ff13 | |
parent | 4079df42168f53de49138bf3f20387afa1f0b542 (diff) |
Ns descriptor related stuffs.
Add a test to query single pnd.
Change-Id: Ia1145476fe39ffb7c953b787c4f10e2288a4a981
Issue-ID: VFC-1037
Signed-off-by: laili <lai.li@zte.com.cn>
-rw-r--r-- | catalog/packages/tests/test_pnf_descriptor.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/catalog/packages/tests/test_pnf_descriptor.py b/catalog/packages/tests/test_pnf_descriptor.py index e5aa8d12..d261968a 100644 --- a/catalog/packages/tests/test_pnf_descriptor.py +++ b/catalog/packages/tests/test_pnf_descriptor.py @@ -55,7 +55,39 @@ class TestPnfDescriptor(TestCase): pass def test_query_single_pnfd_normal(self): - pass + expected_reponse_data = { + 'id': '22', + 'pnfdId': None, + 'pnfdName': None, + 'pnfdVersion': None, + 'pnfdProvider': None, + 'pnfdInvariantId': None, + 'pnfdOnboardingState': 'CREATED', + 'onboardingFailureDetails': None, + 'pnfdUsageState': 'NOT_IN_USE', + 'userDefinedData': { + 'key1': 'value1', + 'key2': 'value2', + 'key3': 'value3', + }, + '_links': None + } + user_defined_data = { + 'key1': 'value1', + 'key2': 'value2', + 'key3': 'value3', + } + user_defined_data = json.JSONEncoder().encode(user_defined_data) + PnfPackageModel( + pnfPackageId='22', + onboardingState='CREATED', + usageState='NOT_IN_USE', + userDefinedData=user_defined_data + ).save() + + response = self.client.get('/api/nsd/v1/pnf_descriptors/22', format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(expected_reponse_data, response.data) def test_delete_single_pnfd_normal(self): pass |