diff options
author | 2017-09-28 10:50:03 -0700 | |
---|---|---|
committer | 2017-09-28 10:50:03 -0700 | |
commit | 5952573e01f2681c45402bde24d3e1ab67d944b5 (patch) | |
tree | 5de8ad29df8077d7535031d696a8fd40dd95c931 /newton/newton/pub | |
parent | 0aa903c0dc422a8660cfe64616a4d191318816e6 (diff) |
Create UTs for Registry APIView
This change creates unit tests for the Registry APIView class
and refactors its code to simplify it and reuse some functionality
Change-Id: I33a01e750e80d4acbae12bbd873484bbb423f1cf
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: MULTICLOUD-83
Diffstat (limited to 'newton/newton/pub')
-rw-r--r-- | newton/newton/pub/tests/test_extsys.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/newton/newton/pub/tests/test_extsys.py b/newton/newton/pub/tests/test_extsys.py index 5ddbbcba..239ebe00 100644 --- a/newton/newton/pub/tests/test_extsys.py +++ b/newton/newton/pub/tests/test_extsys.py @@ -15,6 +15,7 @@ import json import mock +from rest_framework import status import six import unittest @@ -68,9 +69,13 @@ class TestEpaCaps(unittest.TestCase): def test_get_vim_by_id(self): values = [ - (1, "test_content", 500), # Failure first call - (0, json.dumps(MOCK_VIM_INFO), None), (1, "test_content", 500), # Failure second call - (0, json.dumps(MOCK_VIM_INFO), None), (0, json.dumps(MOCK_ESR_SYSTEM_INFO), None) # Success calls + (1, "test_content", + status.HTTP_500_INTERNAL_SERVER_ERROR), # Failure first call + (0, json.dumps(MOCK_VIM_INFO), None), + (1, "test_content", + status.HTTP_500_INTERNAL_SERVER_ERROR), # Failure second call + (0, json.dumps(MOCK_VIM_INFO), None), + (0, json.dumps(MOCK_ESR_SYSTEM_INFO), None) # Success calls ] restcall.req_to_aai = mock.Mock(side_effect=returnList(values)) |