Ejemplo n.º 1
0
 def test_lb_add_sticky1(self, *mocks):
     sticky = {'persistenceType': None}
     api.lb_add_sticky(self.conf, self.lb_id, sticky)
     for mok in mocks:
         self.assertFalse(mok.called)
Ejemplo n.º 2
0
 def addSticky(self, req, **args):
     logger.debug("Got addSticky request. Request: %s", req)
     st_id = core_api.lb_add_sticky(self.conf, args['id'],
                                    args['body'])
     return "sticky: %s" % st_id
Ejemplo n.º 3
0
 def test_lb_add_sticky0(self, *mocks):
     sticky = mock.MagicMock()
     api.lb_add_sticky(self.conf, self.lb_id, sticky)
     for mok in mocks:
         self.assertTrue(mok.called)
 def test_lb_add_sticky1(self, *mocks):
     sticky = {'persistenceType': None}
     resp = api.lb_add_sticky(self.conf, self.lb_id, sticky)
     self.assertEqual(resp, None)
     for mock in mocks:
         self.assertFalse(mock.called)
 def test_lb_add_sticky0(self, *mocks):
     mocks[4].return_value = self.dict_list
     sticky = mock.MagicMock()
     api.lb_add_sticky(self.conf, self.lb_id, sticky)
     for mok in mocks:
         self.assertTrue(mok.called)
Ejemplo n.º 6
0
 def create(self, req, tenant_id, lb_id, body):
     LOG.debug("Got addSticky request. Request: %s", req)
     sticky = core_api.lb_add_sticky(self.conf, tenant_id, lb_id, body)
     return {"sessionPersistence": db_api.unpack_extra(sticky)}
Ejemplo n.º 7
0
 def addSticky(self, req, id, body):
     logger.debug("Got addSticky request. Request: %s", req)
     sticky = core_api.lb_add_sticky(self.conf, id, body)
     return {"sessionPersistence": db_api.unpack_extra(sticky)}
Ejemplo n.º 8
0
 def test_lb_add_sticky1(self, *mocks):
     sticky = {'type': None}
     resp = api.lb_add_sticky(self.conf, 'fake_tenant', self.lb_id, sticky)
     self.assertEqual(resp, None)
     for mock in mocks:
         self.assertFalse(mock.called)