-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16bd84c
commit fb1a0ff
Showing
13 changed files
with
86 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ package-lock.json | |
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# venv | ||
.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import tdp_core.dbmigration.env # NOQA | ||
import tdp_core.dbmigration.env | ||
|
||
tdp_core.dbmigration.env.run_migrations_online() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
from fastapi import FastAPI | ||
from fastapi.testclient import TestClient | ||
from tdp_core.security.manager import SecurityManager | ||
from tdp_core.security.model import User | ||
from tdp_core.server.visyn_server import create_visyn_server | ||
from tdp_core.tests.fixtures.postgres_db import postgres_db | ||
|
||
assert postgres_db # silence unused import warning | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def app(postgres_db) -> FastAPI: | ||
server = create_visyn_server( | ||
workspace_config={ | ||
"tdp_core": {"enabled_plugins": ["tdp_core", "coral"]}, | ||
"coral": { | ||
"dburl": postgres_db.url, | ||
}, | ||
} | ||
) | ||
|
||
return server | ||
|
||
|
||
@pytest.fixture() | ||
def client(monkeypatch, app: FastAPI): | ||
def mock_current_user_in_manager(self): | ||
return User(id="admin") | ||
|
||
monkeypatch.setattr(SecurityManager, "current_user", property(mock_current_user_in_manager)) | ||
|
||
with TestClient(app) as client: | ||
yield client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from fastapi.testclient import TestClient | ||
|
||
|
||
def test_loggedinas(client: TestClient): | ||
assert client.get("/loggedinas").json()["name"] == "admin" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
tdp_core@git+https://github.com/datavisyn/tdp_core.git@develop#egg=tdp_core | ||
tdp_core@git+https://github.com/datavisyn/tdp_core.git@upgrade_python_deps#egg=tdp_core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
black~=22.3.0 | ||
debugpy~=1.5.1 | ||
flake8~=4.0.1 | ||
isort~=5.10.1 | ||
mkdocs-material~=8.2.8 | ||
pep8-naming~=0.12.1 | ||
black~=22.12.0 | ||
pyright~=1.1.285 | ||
pytest-runner~=6.0.0 | ||
pytest~=7.1.1 | ||
recommonmark~=0.7.1 | ||
pytest~=7.2.0 | ||
ruff==0.0.218 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters