예제 #1
0
 def test_get_data(self, mock_api, mock_unpack):
     mock_unpack.return_value = {"virtualIps": 1}
     api.lb_get_data(self.conf, self.lb_id)
     self.assertTrue(mock_api.called)
     self.assertTrue(mock_unpack.called)
예제 #2
0
 def show(self, req, **args):
     logger.debug("Got loadbalancerr info request. Request: %s", req)
     result = core_api.lb_get_data(self.conf, args['id'])
     return {'loadbalancer': result}
예제 #3
0
 def test_get_data(self, mock_api):
     api.lb_get_data(self.conf, self.lb_id)
     self.assertTrue(mock_api.called)
 def test_lb_get_data_1(self, mock_api, mock_bal):
     mock_api.return_value = {"id": 1, "virtualIps": "cranch"}
     res = api.lb_get_data(self.conf, self.lb_id)
     self.assertTrue(mock_api.called)
     self.assertEquals(res, {"id": 1})
예제 #5
0
 def show(self, req, id):
     LOG.debug("Got loadbalancerr info request. Request: %s", req)
     result = core_api.lb_get_data(self.conf, id)
     return {'loadbalancer': result}
예제 #6
0
 def test_lb_get_data_0(self, mock_api, mock_bal):
     api.lb_get_data(self.conf, 'fake_tenant', self.lb_id)
     self.assertTrue(mock_api.called)