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)
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
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)
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)}
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)}
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)