示例#1
0
 def test_lsn_port_get_with_filters_return_none(self):
     self.mock_request.return_value = {
         "results": [{"uuid": "foo1"}, {"uuid": "foo2"}],
         "result_count": 2
     }
     result = lsnlib._lsn_port_get(self.cluster, "lsn_id", None)
     self.assertIsNone(result)
示例#2
0
文件: test_lsn.py 项目: pjh03/quantum
 def test_lsn_port_get_with_filters_return_none(self):
     self.mock_request.return_value = {
         "results": [{"uuid": "foo1"}, {"uuid": "foo2"}],
         "result_count": 2
     }
     result = lsnlib._lsn_port_get(self.cluster, "lsn_id", None)
     self.assertIsNone(result)
示例#3
0
 def test_lsn_port_get_with_filters(self):
     lsn_id = "foo_lsn_id"
     port_id = "foo_port_id"
     filters = {"tag": "foo_tag", "tag_scope": "foo_scope"}
     self.mock_request.return_value = {
         "results": [{"uuid": port_id}],
         "result_count": 1
     }
     result = lsnlib._lsn_port_get(self.cluster, lsn_id, filters)
     self.assertEqual(result, port_id)
     self.mock_request.assert_called_once_with(
         "GET",
         ("/ws.v1/lservices-node/%s/lport?fields=uuid&tag_scope=%s&"
          "tag=%s" % (lsn_id, filters["tag_scope"], filters["tag"])),
         cluster=self.cluster)
示例#4
0
文件: test_lsn.py 项目: pjh03/quantum
 def test_lsn_port_get_with_filters(self):
     lsn_id = "foo_lsn_id"
     port_id = "foo_port_id"
     filters = {"tag": "foo_tag", "tag_scope": "foo_scope"}
     self.mock_request.return_value = {
         "results": [{"uuid": port_id}],
         "result_count": 1
     }
     result = lsnlib._lsn_port_get(self.cluster, lsn_id, filters)
     self.assertEqual(result, port_id)
     self.mock_request.assert_called_once_with(
         "GET",
         ("/ws.v1/lservices-node/%s/lport?fields=uuid&tag_scope=%s&"
          "tag=%s" % (lsn_id, filters["tag_scope"], filters["tag"])),
         cluster=self.cluster)