def test_401(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/blue/fail') pipeline.incr.assert_called_once_with('balls.blueprint_fail.http_401')
def test_200(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/') pipeline.incr.assert_called_once_with('index.http_200')
def test_302(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/blue/redirect') pipeline.incr.assert_called_once_with('balls.blueprint_redir.http_302')
def test_301_to_route_with_slash(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/slash') pipeline.incr.assert_called_once_with('None.http_301')
def test_404(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/blue/hello') pipeline.incr.assert_called_once_with('None.http_404')
def test_301_to_route_with_slash(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/blue/slash') self.assertFalse(pipeline.timing.called)
def test_404(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/hello') self.assertFalse(pipeline.timing.called)
def test_setup_single_application(self): app = self._create_app('hello') stats = Stats(app).client pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/') self.assertTrue(pipeline.incr.called) pipeline.incr.assert_called_once_with('index.http_200') pipeline.timing.assert_called_once_with('index', TimingValue(0.03 * 1000, 10))