summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaili <lai.li@zte.com.cn>2018-08-24 19:51:17 +0800
committerlaili <lai.li@zte.com.cn>2018-08-27 09:34:52 +0800
commit4079df42168f53de49138bf3f20387afa1f0b542 (patch)
treeac50156edb9673ee94bcd7b515aa705266627500
parent4cbfd5040075d303667bede35f4235cb5d8bd65d (diff)
Ns descriptor related stuffs.
Add a test to deletion of single nsd. Change-Id: I38a7640a43e3f47f4f49ca4d09a827633564db66 Issue-ID: VFC-1037 Signed-off-by: laili <lai.li@zte.com.cn>
-rw-r--r--catalog/packages/tests/test_ns_descriptor.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/catalog/packages/tests/test_ns_descriptor.py b/catalog/packages/tests/test_ns_descriptor.py
index d7e09e34..c6eda2fe 100644
--- a/catalog/packages/tests/test_ns_descriptor.py
+++ b/catalog/packages/tests/test_ns_descriptor.py
@@ -158,7 +158,22 @@ class TestNsDescriptor(TestCase):
self.assertEqual(expected_reponse_data, response.data)
def test_delete_single_nsd_normal(self):
- pass
+ user_defined_data = {
+ 'key1': 'value1',
+ 'key2': 'value2',
+ 'key3': 'value3',
+ }
+ user_defined_data = json.JSONEncoder().encode(user_defined_data)
+ NSPackageModel(
+ nsPackageId='22',
+ operationalState='DISABLED',
+ usageState='NOT_IN_USE',
+ userDefinedData=user_defined_data,
+ nsdModel='test'
+ ).save()
+ resp = self.client.delete("/api/nsd/v1/ns_descriptors/22", format='json')
+ self.assertEqual(resp.status_code, status.HTTP_204_NO_CONTENT)
+ self.assertEqual({}, resp.data)
def test_nsd_content_upload_normal(self):
user_defined_data_json = json.JSONEncoder().encode(self.user_defined_data)