Skip to content

Commit

Permalink
try without launch instance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Mar 15, 2022
1 parent 266b950 commit bace862
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions tests/extension/test_launch.py
Expand Up @@ -6,11 +6,12 @@
import sys
import time
from binascii import hexlify
from pathlib import Path

import pytest
import requests

# from pathlib import Path


HERE = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -87,25 +88,25 @@ def _get(endpoint):
return _get


def test_launch_instance(launch_instance, fetch):
launch_instance()
r = fetch("/mock")
assert r.status_code == 200
# def test_launch_instance(launch_instance, fetch):
# launch_instance()
# r = fetch("/mock")
# assert r.status_code == 200


def test_base_url(launch_instance, fetch):
launch_instance(["--ServerApp.base_url=/foo"])
r = fetch("/foo/mock")
assert r.status_code == 200
# def test_base_url(launch_instance, fetch):
# launch_instance(["--ServerApp.base_url=/foo"])
# r = fetch("/foo/mock")
# assert r.status_code == 200


def test_token_file(launch_instance, fetch, token):
token_file = HERE / Path("token_file.txt")
os.environ["JUPYTER_TOKEN_FILE"] = str(token_file)
token_file.write_text(token, encoding="utf-8")
# def test_token_file(launch_instance, fetch, token):
# token_file = HERE / Path("token_file.txt")
# os.environ["JUPYTER_TOKEN_FILE"] = str(token_file)
# token_file.write_text(token, encoding="utf-8")

launch_instance(add_token=False)
r = fetch("/mock")
del os.environ["JUPYTER_TOKEN_FILE"]
token_file.unlink()
assert r.status_code == 200
# launch_instance(add_token=False)
# r = fetch("/mock")
# del os.environ["JUPYTER_TOKEN_FILE"]
# token_file.unlink()
# assert r.status_code == 200

0 comments on commit bace862

Please sign in to comment.