forked from jupyter-server/jupyter_server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add server-side unit tests (jupyter-server#54)
* add basic tests for traits * fix traits to load dynamically * initial proviser tests * add initial provisioner tests * add missing undefined trait * more provisioner tests * working provisioner tests * add coverage to tests * address coverage gaps * add basic app tests * more app tests and kernelspec tests * refactor main app class to instantiate the NotebookServiceClient * minor reformatting fixes
- Loading branch information
Showing
22 changed files
with
749 additions
and
153 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
omit = data_studio_jupyter_extensions/tests/* | ||
data_studio_jupyter_extensions/config/* | ||
conftest.py |
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,4 +1,41 @@ | ||
import pytest | ||
from attr import s | ||
|
||
from data_studio_jupyter_extensions import constants | ||
from data_studio_jupyter_extensions.tests.mock.utils import load_openapi_spec | ||
|
||
|
||
pytest_plugins = ["jupyter_server.pytest_plugin"] | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def openapi_spec(): | ||
return load_openapi_spec() | ||
|
||
|
||
@pytest.fixture | ||
def project_id(): | ||
return "testproject" | ||
|
||
|
||
@pytest.fixture | ||
def notebook_id(): | ||
return "testnotebook" | ||
|
||
|
||
@pytest.fixture | ||
def process_id(): | ||
return "testprocess" | ||
|
||
|
||
@pytest.fixture | ||
def app_base_url(http_server_port): | ||
port = http_server_port[-1] | ||
return f"http://127.0.0.1:{port}" | ||
|
||
|
||
@pytest.fixture | ||
def datastudio_env(monkeypatch, project_id, notebook_id, app_base_url): | ||
monkeypatch.setenv(constants.DS_PROJECT_ID, project_id) | ||
monkeypatch.setenv(constants.DS_NOTEBOOK_ID, notebook_id) | ||
monkeypatch.setenv(constants.DS_API_URL, app_base_url) |
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 +1 @@ | ||
__version__ = "0.1" | ||
__version__ = "0.1" # pragma: no cover |
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
Oops, something went wrong.