Skip to content

Commit

Permalink
clean ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
fanqingsong committed Dec 10, 2023
1 parent 310f62f commit 114fa8b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ uninstall:

test:
# Unit tests with coverage report
coverage erase
coverage run --rcfile=./.coveragerc -m pytest -c tests
coverage report --rcfile=./.coveragerc
coverage html --rcfile=./.coveragerc
pytest --cov=./tests

check:
flake8 fastapi_hive/ --select=E9,F63,F7,F82
Expand Down
2 changes: 1 addition & 1 deletion example/cornerstone/db/implement.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


from sqlalchemy import create_engine
from sqlalchemy.orm import declarative_base
from sqlalchemy.ext.declarative import declarative_base
from fastapi import FastAPI
from example.cornerstone.config import DATABASE_URL
from fastapi_sqlalchemy import DBSessionMiddleware # middleware helper
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api/test_api_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@


def test_auth_using_prediction_api_no_apikey_header(test_client) -> None:
response = test_client.post('/api/endpoints_package1/house_price/predict')
response = test_client.post('/api/house_price/predict')
assert response.status_code == 400
assert response.json() == {"detail": messages.NO_API_KEY}


def test_auth_using_prediction_api_wrong_apikey_header(test_client) -> None:
response = test_client.post(
'/api/endpoints_package1/house_price/predict',
'/api/house_price/predict',
json={"image": "test"},
headers={"token": "WRONG_TOKEN"}
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api/test_heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_heartbeat(test_client) -> None:
response = test_client.get('/api/endpoints_package1/heart_beat/heartbeat')
response = test_client.get('/api/heart_beat/heartbeat')
assert response.status_code == 200
assert response.json() == {"is_alive": True}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_api/test_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def test_prediction(test_client) -> None:
response = test_client.post(
"/api/endpoints_package1/house_price/predict",
"/api/house_price/predict",
json={
"median_income_in_block": 8.3252,
"median_house_age_in_block": 41,
Expand All @@ -25,7 +25,7 @@ def test_prediction(test_client) -> None:

def test_prediction_nopayload(test_client) -> None:
response = test_client.post(
"/api/endpoints_package1/house_price/predict",
"/api/house_price/predict",
json={},
headers={"token": str(config.API_KEY)}
)
Expand Down

0 comments on commit 114fa8b

Please sign in to comment.