merge salv fix for bug 841982, fix minor pep8 violation
This commit is contained in:
@@ -170,6 +170,8 @@ def port_create(net_id, state=None):
|
||||
|
||||
|
||||
def port_list(net_id):
|
||||
# confirm network exists
|
||||
network_get(net_id)
|
||||
session = get_session()
|
||||
return session.query(models.Port).\
|
||||
filter_by(network_id=net_id).\
|
||||
|
||||
@@ -298,6 +298,15 @@ class APITest(unittest.TestCase):
|
||||
self.assertEqual(len(port_data['ports']), 2)
|
||||
LOG.debug("_test_list_ports - format:%s - END", format)
|
||||
|
||||
def _test_list_ports_networknotfound(self, format):
|
||||
LOG.debug("_test_list_ports_networknotfound"
|
||||
" - format:%s - START", format)
|
||||
list_port_req = testlib.port_list_request(self.tenant_id,
|
||||
"A_BAD_ID", format)
|
||||
list_port_res = list_port_req.get_response(self.api)
|
||||
self.assertEqual(list_port_res.status_int, 420)
|
||||
LOG.debug("_test_list_ports_networknotfound - format:%s - END", format)
|
||||
|
||||
def _test_list_ports_detail(self, format):
|
||||
LOG.debug("_test_list_ports_detail - format:%s - START", format)
|
||||
content_type = "application/%s" % format
|
||||
@@ -882,6 +891,12 @@ class APITest(unittest.TestCase):
|
||||
def test_list_ports_xml(self):
|
||||
self._test_list_ports('xml')
|
||||
|
||||
def test_list_ports_networknotfound_json(self):
|
||||
self._test_list_ports_networknotfound('json')
|
||||
|
||||
def test_list_ports_networknotfound_xml(self):
|
||||
self._test_list_ports_networknotfound('xml')
|
||||
|
||||
def test_list_ports_detail_json(self):
|
||||
self._test_list_ports_detail('json')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user