def test_ok(self, app): response = app.get("/contribute.json", status=200) assert response.content_type == "application/json" data = response.json assert "repository" in data.keys() assert "license" in data["repository"] assert data["repository"]["license"] == "Apache 2.0"
def test_ok(self, app): response = app.get('/__version__', status=200) assert response.content_type == 'application/json' data = response.json assert (set(data.keys()) == set(['build', 'commit', 'source', 'tag', 'version'])) assert data['source'] == 'https://github.com/mozilla/ichnaea'
def test_ok(self, app): response = app.get("/__version__", status=200) assert response.content_type == "application/json" data = response.json assert set(data.keys()) == set( ["build", "commit", "source", "version"]) assert data["source"] == "https://github.com/mozilla/ichnaea"
def test_ok(self, app): response = app.get('/contribute.json', status=200) assert response.content_type == 'application/json' data = response.json assert 'repository' in data.keys() assert 'license' in data['repository'] assert data['repository']['license'] == 'Apache 2.0'
def test_ok(self, app): response = app.get('/__version__', status=200) assert response.content_type == 'application/json' data = response.json assert (set(data.keys()) == set( ['build', 'commit', 'source', 'tag', 'version'])) assert data['source'] == 'https://github.com/mozilla/ichnaea'
def test_ok(self, app): response = app.get("/__heartbeat__", status=200) assert response.content_type == "application/json" data = response.json timed_services = set(["database", "geoip", "redis"]) assert set(data.keys()) == timed_services for name in timed_services: assert data[name]["up"] assert isinstance(data[name]["time"], int) assert data[name]["time"] >= 0 assert 1 < data["geoip"]["age_in_days"] < 1000
def test_ok(self, app): response = app.get('/__heartbeat__', status=200) assert response.content_type == 'application/json' data = response.json timed_services = set(['database', 'geoip', 'redis']) assert set(data.keys()) == timed_services for name in timed_services: assert data[name]['up'] assert isinstance(data[name]['time'], int) assert data[name]['time'] >= 0 assert 1 < data['geoip']['age_in_days'] < 1000
def test_no_cors_headers(self, app): """LBHeartbeat does not allow CORS.""" res = app.get("/__lbheartbeat__", status=200) assert "Access-Control-Allow-Origin" not in res.headers assert "Access-Control-Max-Age" not in res.headers
def test_get(self, app): res = app.get("/__lbheartbeat__", status=200) assert res.content_type == "application/json" assert res.json["status"] == "OK"
def test_get(self, app): res = app.get("/__lbheartbeat__", status=200) assert res.content_type == "application/json" assert res.json["status"] == "OK" assert res.headers["Access-Control-Allow-Origin"] == "*" assert res.headers["Access-Control-Max-Age"] == "2592000"
def test_get(self, app): res = app.get('/__lbheartbeat__', status=200) assert res.content_type == 'application/json' assert res.json['status'] == 'OK' assert res.headers['Access-Control-Allow-Origin'] == '*' assert res.headers['Access-Control-Max-Age'] == '2592000'