Skip to content

Commit f630c27

Browse files
committed
fix: version endpoint and test now rely on common variable
Change-Id: Ic78a7a25e83c33196fe9b73d82133e8375408338
1 parent 51dd695 commit f630c27

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

gnpyapi/core/route/status_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
@app.route(API_VERSION + '/status', methods=['GET'])
77
def api_status():
8-
return {"version": "v0.2", "status": "ok"}, 200
8+
return {"version": f"{API_VERSION}", "status": "ok"}, 200

tests/test_api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99
from flask_injector import FlaskInjector
1010

11-
from gnpyapi.core import app
11+
from gnpyapi.core import app, API_VERSION
1212
from tests.utils.input import read_json_file
1313

1414

@@ -17,8 +17,6 @@
1717
TEST_REQ_DIR = TEST_DATA_DIR / 'req'
1818
TEST_RES_DIR = TEST_DATA_DIR / 'res'
1919

20-
API_VERSION = '/api/v0.2'
21-
2220

2321
@pytest.fixture
2422
def client():
@@ -49,4 +47,4 @@ def test_legacy_echo(client):
4947
def test_status(client):
5048
response = client.get(f"{API_VERSION}/status")
5149
assert response.status_code == 200
52-
assert response.get_json() == {"version": "v0.2", "status": "ok"}
50+
assert response.get_json() == {"version": f"{API_VERSION}", "status": "ok"}

0 commit comments

Comments
 (0)