summaryrefslogtreecommitdiffstats
path: root/windriver/titanium_cloud/registration/tests/test_registration2.py
diff options
context:
space:
mode:
Diffstat (limited to 'windriver/titanium_cloud/registration/tests/test_registration2.py')
-rw-r--r--windriver/titanium_cloud/registration/tests/test_registration2.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/windriver/titanium_cloud/registration/tests/test_registration2.py b/windriver/titanium_cloud/registration/tests/test_registration2.py
index a9c034a8..9f0cd4d2 100644
--- a/windriver/titanium_cloud/registration/tests/test_registration2.py
+++ b/windriver/titanium_cloud/registration/tests/test_registration2.py
@@ -15,19 +15,19 @@
import mock
import unittest
-import json
+# import json
from django.test import Client
from rest_framework import status
-from django.core.cache import cache
-from common.msapi import extsys
+# from django.core.cache import cache
+# from common.msapi import extsys
from common.utils import restcall
-from newton_base.tests import mock_info
-from newton_base.tests import test_base
-from newton_base.util import VimDriverUtils
+# from newton_base.tests import mock_info
+# from newton_base.tests import test_base
+# from newton_base.util import VimDriverUtils
-from newton_base.registration import registration as newton_registration
+# from newton_base.registration import registration as newton_registration
from titanium_cloud.registration.views import registration
from newton_base.tests import test_base
@@ -55,8 +55,8 @@ MOCK_GET_FLAVOR_RESPONSE = {
"id": "1", "name": "micro", "vcpus": 1, "ram": "1MB",
"disk": "1G", "OS-FLV-EXT-DATA:ephemeral": False,
"swap": True, "os-flavor-access:is_public": True,
- "OS-FLV-DISABLED:disabled": True, "link": [{"href":1}]
- },
+ "OS-FLV-DISABLED:disabled": True, "link": [{"href": 1}]
+ },
{
"id": "2", "name": "mini", "vcpus": 2, "ram": "2MB",
"disk": "2G", "OS-FLV-EXT-DATA:ephemeral": True,
@@ -72,14 +72,15 @@ MOCK_GET_FLAVOR_RESPONSE_w_hpa_numa = {
"id": "1", "name": "onap.big", "vcpus": 6, "ram": "8192",
"disk": "10", "OS-FLV-EXT-DATA:ephemeral": False,
"swap": True, "os-flavor-access:is_public": True,
- "OS-FLV-DISABLED:disabled": True, "link": [{"href":1}]
- }
+ "OS-FLV-DISABLED:disabled": True, "link": [{"href": 1}]
+ }
]
}
MOCK_GET_FLAVOR_EXTRASPECS_RESPONSE_w_hpa_numa = {
"hw:numa_nodes": 2
}
+
class TestRegistration2(unittest.TestCase):
def setUp(self):
self.client = Client()
@@ -88,13 +89,12 @@ class TestRegistration2(unittest.TestCase):
def tearDown(self):
pass
-
def test_discover_flavors(self):
restcall.req_to_aai = mock.Mock()
restcall.req_to_aai.return_value = (0, {}, status.HTTP_200_OK)
- mock_session = test_base.get_mock_session(
- ["get"], {"get": {
- "content": MOCK_GET_FLAVOR_RESPONSE}}),
+ mock_session = test_base.get_mock_session(
+ ["get"], {"get": {
+ "content": MOCK_GET_FLAVOR_RESPONSE}}),
resp = self.view._discover_flavors(vimid="windriver-hudson-dc_RegionOne",
session=mock_session, viminfo=MOCK_VIM_INFO)
@@ -105,8 +105,8 @@ class TestRegistration2(unittest.TestCase):
restcall.req_to_aai = mock.Mock()
restcall.req_to_aai.return_value = (0, {}, status.HTTP_200_OK)
mock_session = test_base.get_mock_session(
- ["get"], {"side_effect": [{
- "content": MOCK_GET_FLAVOR_RESPONSE_w_hpa_numa},
+ ["get"], {"side_effect": [{
+ "content": MOCK_GET_FLAVOR_RESPONSE_w_hpa_numa},
{
"content": MOCK_GET_FLAVOR_EXTRASPECS_RESPONSE_w_hpa_numa}
]}),