def test_resource_head(self, app): resource = restplus.Resource() with pytest.raises(AssertionError): resource.dispatch_request()
def test_resource_resp(self, app, mocker): resource = restplus.Resource() resource.get = mocker.Mock() with app.test_request_context("/foo"): resource.get.return_value = flask.make_response('') resource.dispatch_request()
def test_resource_head(self): resource = restplus.Resource() with self.app.test_request_context("/foo", method="HEAD"): self.assertRaises(AssertionError, lambda: resource.dispatch_request())
def test_resource(self, app, mocker): resource = restplus.Resource() resource.get = mocker.Mock() with app.test_request_context("/foo"): resource.dispatch_request()
def test_resource(self): resource = restplus.Resource() resource.get = Mock() with self.app.test_request_context("/foo"): resource.dispatch_request()