userDefinedData=user_defined_data_json,
).save()
mock_parse_pnfd.return_value = json.JSONEncoder().encode(pnfd_data)
userDefinedData=user_defined_data_json,
).save()
mock_parse_pnfd.return_value = json.JSONEncoder().encode(pnfd_data)
@mock.patch.object(toscaparsers, "parse_pnfd")
def test_pnfd_content_upload_when_pnfd_exist(self, mock_parse_pnfd):
@mock.patch.object(toscaparsers, "parse_pnfd")
def test_pnfd_content_upload_when_pnfd_exist(self, mock_parse_pnfd):
self.assertEqual(resp.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR)
def test_pnfd_download_normal(self):
self.assertEqual(resp.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR)
def test_pnfd_download_normal(self):
for data in resp.streaming_content:
file_content = '%s%s' % (file_content, data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
for data in resp.streaming_content:
file_content = '%s%s' % (file_content, data)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_pnfd_download_when_not_on_boarded(self):
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_pnfd_download_when_not_on_boarded(self):