Skip to content

Commit

Permalink
Merge pull request #65 from davidbrochart/test_settings
Browse files Browse the repository at this point in the history
Add settings test
  • Loading branch information
davidbrochart authored Sep 22, 2021
2 parents b7dac49 + df520c1 commit c8eb062
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import json

import pytest
from fastapi.testclient import TestClient


@pytest.mark.parametrize("auth_mode", ("noauth",))
def test_put_settings(auth_mode, client, app):
with TestClient(app) as client:
response = client.put(
"/lab/api/settings/@jupyterlab/apputils-extension:themes",
data='{"raw":"my_settings"}',
)
assert response.status_code == 204


@pytest.mark.parametrize("auth_mode", ("noauth",))
def test_get_settings(auth_mode, client, app):
with TestClient(app) as client:
response = client.get("/lab/api/settings/@jupyterlab/apputils-extension:themes")
assert response.status_code == 200
assert json.loads(response.content)["raw"] == "my_settings"

0 comments on commit c8eb062

Please sign in to comment.