def setUp(self): app.config['TESTING'] = True app.testing = True # required to check for exceptions self.client = app.test_client()
def test_crossdomain(self): with app.test_client() as client: res = client.get('/') nose.tools.assert_equals(res.status_code, 200)
def test_error(self): with app.test_client() as client: with nose.tools.assert_raises(ServiceNotFound) as not_found: res = client.get('/non-existent') nose.tools.assert_equal(not_found.code, 404)
def test_index_root(self): with app.test_client() as client: res = self.client.get('/', follow_redirects=True) nose.tools.assert_equals(res.status_code, 200)