def test_getChild(self): """Test case for `PoolServers.getChild`""" r = PoolServers(self.coordinators[0]) self.assertEquals(r, r.getChild("", self.request)) self.assertIsInstance(r.getChild("mw2001", self.request), Resp404) res = r.getChild("mw1010", self.request) self.assertIsInstance(res, PoolServer) self.assertEquals(res.server.host, 'mw1010')
def test_render(self): """Test case for `PoolServers.render_GET`""" r = PoolServers(self.coordinators[0]) resp = json.loads(r.render_GET(self.request)) self.assertIn('mw1009', resp) self.assertEquals(resp['mw1008'], { u'pooled': True, u'up': True, u'weight': 10 })
def test_render(self): """Test case for `PoolServers.render_GET`""" r = PoolServers(self.coordinators[0]) resp = json.loads(r.render_GET(self.request)) self.assertIn('mw1009', resp) self.assertEquals(resp['mw1008'], {u'pooled': True, u'up': True, u'weight': 10})