Created
December 7, 2016 21:22
-
-
Save ahsan518/b7f489c38b2c685f13c86c3312ed1fea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== | |
ERROR: craton.tests.unit.test_api.APIV1NetInterfacesTest.test_get_netinterfaces_by_device_id | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/nose/case.py", line 134, in run | |
self.runTest(result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/nose/case.py", line 152, in runTest | |
test(result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 673, in __call__ | |
return self.run(*args, **kwds) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 671, in run | |
return run_test.run(result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py", line 80, in run | |
return self._run_one(actual_result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py", line 94, in _run_one | |
return self._run_prepared_result(ExtendedToOriginalDecorator(result)) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py", line 108, in _run_prepared_result | |
self._run_core() | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py", line 145, in _run_core | |
failed = True | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py", line 145, in _run_core | |
failed = True | |
File "/usr/lib/python3.5/bdb.py", line 48, in trace_dispatch | |
return self.dispatch_line(frame) | |
File "/usr/lib/python3.5/bdb.py", line 67, in dispatch_line | |
if self.quitting: raise BdbQuit | |
bdb.BdbQuit: | |
-------------------- >> begin captured stdout << --------------------- | |
> /home/ubuntu/craton/craton/tests/unit/test_api.py(719)test_get_netinterfaces_by_device_id() | |
-> fake_interfaces.return_value = fake_resources.NETINTERFACE2 | |
(Pdb) > /home/ubuntu/craton/craton/tests/unit/test_api.py(720)test_get_netinterfaces_by_device_id() | |
-> resp = self.get('/v1/net_interfaces?device_id=2') | |
(Pdb) > /home/ubuntu/craton/craton/tests/unit/test_api.py(721)test_get_netinterfaces_by_device_id() | |
-> print(resp.json) | |
(Pdb) [] | |
> /home/ubuntu/craton/craton/tests/unit/test_api.py(722)test_get_netinterfaces_by_device_id() | |
-> netinterface_resp = fake_resources.NETINTERFACE2 | |
(Pdb) > /home/ubuntu/craton/craton/tests/unit/test_api.py(724)test_get_netinterfaces_by_device_id() | |
-> self.assertEqual(resp.json[0]["name"], netinterface_resp.name) | |
(Pdb) IndexError: list index out of range | |
> /home/ubuntu/craton/craton/tests/unit/test_api.py(724)test_get_netinterfaces_by_device_id() | |
-> self.assertEqual(resp.json[0]["name"], netinterface_resp.name) | |
(Pdb) --Return-- | |
> /home/ubuntu/craton/craton/tests/unit/test_api.py(724)test_get_netinterfaces_by_device_id()->None | |
-> self.assertEqual(resp.json[0]["name"], netinterface_resp.name) | |
(Pdb) IndexError: list index out of range | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1305)patched() | |
-> return func(*args, **keywargs) | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1306)patched() | |
-> except: | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1307)patched() | |
-> if (patching not in entered_patchers and | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1313)patched() | |
-> exc_info = sys.exc_info() | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1315)patched() | |
-> raise | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1317)patched() | |
-> for patching in reversed(entered_patchers): | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1318)patched() | |
-> patching.__exit__(*exc_info) | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1317)patched() | |
-> for patching in reversed(entered_patchers): | |
(Pdb) --Return-- | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/mock/mock.py(1317)patched()->None | |
-> for patching in reversed(entered_patchers): | |
(Pdb) IndexError: list index out of range | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py(719)_run_test_method() | |
-> return self._get_test_method()() | |
(Pdb) --Return-- | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py(719)_run_test_method()->None | |
-> return self._get_test_method()() | |
(Pdb) IndexError: list index out of range | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py(191)_run_user() | |
-> return fn(*args, **kwargs) | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py(192)_run_user() | |
-> except: | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py(193)_run_user() | |
-> return self._got_user_exception(sys.exc_info()) | |
(Pdb) --Return-- | |
> /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py(193)_run_user()-><object objec...x7ff7680fede0> | |
-> return self._got_user_exception(sys.exc_info()) | |
(Pdb) > /home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/testtools/runtest.py(145)_run_core() | |
-> failed = True | |
(Pdb) | |
--------------------- >> end captured stdout << ---------------------- | |
-------------------- >> begin captured logging << -------------------- | |
craton.api.v1.resources.inventory.networks: INFO: Getting all netinterface objects that match filters {'device_id': 2} | |
--------------------- >> end captured logging << --------------------- | |
---------------------------------------------------------------------- | |
Ran 221 tests in 7.977s | |
FAILED (errors=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 class NetInterface(): | |
~ 153 def __init__(self, name, device_id, project_id, interface_type, | |
+ 154 ┆ ┆ ┆ ┆ip_address, variables): | |
155 ┆ self.name = name | |
156 ┆ self.device_id = device_id | |
+ 157 ┆ self.project_id = project_id | |
158 ┆ self.interface_type = interface_type | |
159 ┆ self.ip_address = ip_address | |
+ 160 ┆ self.variables = variables | |
161 | |
162 def items(self): | |
163 ┆ return iter(self.__dict__.items()) | |
164 | |
165 | |
~ 166 NETINTERFACE1 = NetInterface("NetInterface", 1, 1, "interface_type1", | |
~ 167 ┆ ┆ ┆ ┆ ┆ ┆ ┆"10.10.0.1", | |
~ 168 ┆ ┆ ┆ ┆ ┆ ┆ ┆{"key1": "value1", "key2": "value2"}) | |
+ 169 | |
+ 170 NETINTERFACE2 = NetInterface("Sample", 2, 1, "Sample1", "10.0.0.2", {"a": "b"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ 716 @mock.patch.object(dbapi, 'net_interfaces_get_by_device') | |
+ 717 def test_get_netinterfaces_by_device_id(self, fake_interfaces): | |
+ 718 ┆ pdb.set_trace() | |
+ 719 ┆ fake_interfaces.return_value = fake_resources.NETINTERFACE2 | |
+ 720 ┆ resp = self.get('/v1/net_interfaces?device_id=2') | |
+ 721 ┆ print(resp.json) | |
+ 722 ┆ netinterface_resp = fake_resources.NETINTERFACE2 | |
+ 723 # self.assertEqual(len(resp.json), len()) | |
+ 724 ┆ self.assertEqual(resp.json[0]["name"], netinterface_resp.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment