def test_413(self): self.assertTrue( controllers.check_413("post", Service("bar", "/bar", [ "POST", ]), app, app.post, {}, [ 3, ]))
def test_service_config(self): config = WalintParser() config.readfp(io.BytesIO(_SAMPLE_CONFIG)) service = Service.from_config(config, "service:bar") self.assertEquals(service.path, "/bar") self.assertEquals(service.methods, ["GET", "PUT"]) self.assertEquals(service.params, ['foo', 'bar'])
def test_405(self): services = {'bar': Service("bar", "/bar", ["GET", "POST", "PUT"])} self.assertTrue(singles.check_405(app, {}, services))
def test_414(self): self.assertTrue( controllers.check_414("get", Service("bar", "/bar", [ "GET", ]), app, app.get, {}))
def test_auth_breaker(self): self.assertTrue( controllers.auth_breaker("get", Service("bar", "/bar", [ "GET", ]), app, app.get, {}))
def test_json_breaker(self): self.assertTrue( controllers.json_breaker("post", Service("bar", "/bar", ["POST", "PUT"]), app, app.post, {}))
def test_basic_auth(self): self.assertTrue( controllers.auth_basic("get", Service("bar", "/bar", ["GET", "POST"]), app, app.get, {}, ('foo', 'bar')))