Skip to content

Commit

Permalink
Fix integrate test
Browse files Browse the repository at this point in the history
  • Loading branch information
hv0905 committed May 10, 2024
1 parent 0b14ec2 commit 9f488ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
TEST_ACCESS_TOKEN = 'test_token'
TEST_ADMIN_TOKEN = 'test_admin_token'

config.config.qdrant.mode = "memory"
config.config.admin_api_enable = True
config.config.access_protected = True
config.config.access_token = TEST_ACCESS_TOKEN
config.config.admin_token = TEST_ADMIN_TOKEN
config.config.storage.method = config.StorageMode.LOCAL


@pytest.fixture(scope="session")
def test_client(tmp_path_factory) -> TestClient:
# Modify the configuration for testing
config.config.qdrant.mode = "memory"
config.config.admin_api_enable = True
config.config.access_protected = True
config.config.access_token = 'test_token'
config.config.admin_token = 'test_admin_token'
config.config.storage.method = config.StorageMode.LOCAL
config.config.storage.local.path = tmp_path_factory.mktemp("static_files")

from app.webapp import app
Expand Down
2 changes: 2 additions & 0 deletions tests/api/integrate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
@pytest.mark.asyncio
async def test_integrate(test_client):
credentials = {'x-admin-token': TEST_ADMIN_TOKEN, 'x-access-token': TEST_ACCESS_TOKEN}
resp = test_client.get("/", headers=credentials)
assert resp.status_code == 200
img_ids = dict()
for img_cls in test_images:
img_ids[img_cls] = []
Expand Down

0 comments on commit 9f488ec

Please sign in to comment.