pre-commit: run black with string normalization

This commit is contained in:
Erik Sundell
2021-11-03 23:55:34 +01:00
parent 2ba942ba76
commit e0aaa4f995
31 changed files with 700 additions and 692 deletions

View File

@@ -9,30 +9,30 @@ import subprocess
from tljh.config import CONFIG_FILE, USER_ENV_PREFIX, HUB_ENV_PREFIX
from tljh import user
yaml = YAML(typ='rt')
yaml = YAML(typ="rt")
def test_apt_packages():
"""
Test extra apt packages are installed
"""
assert os.path.exists('/usr/games/sl')
assert os.path.exists("/usr/games/sl")
def test_pip_packages():
"""
Test extra user & hub pip packages are installed
"""
subprocess.check_call([f'{USER_ENV_PREFIX}/bin/python3', '-c', 'import django'])
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import django"])
subprocess.check_call([f'{HUB_ENV_PREFIX}/bin/python3', '-c', 'import there'])
subprocess.check_call([f"{HUB_ENV_PREFIX}/bin/python3", "-c", "import there"])
def test_conda_packages():
"""
Test extra user conda packages are installed
"""
subprocess.check_call([f'{USER_ENV_PREFIX}/bin/python3', '-c', 'import hypothesis'])
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import hypothesis"])
def test_config_hook():
@@ -42,16 +42,16 @@ def test_config_hook():
with open(CONFIG_FILE) as f:
data = yaml.load(f)
assert data['simplest_plugin']['present']
assert data["simplest_plugin"]["present"]
def test_jupyterhub_config_hook():
"""
Test that tmpauthenticator is enabled by our custom config plugin
"""
resp = requests.get('http://localhost/hub/tmplogin', allow_redirects=False)
resp = requests.get("http://localhost/hub/tmplogin", allow_redirects=False)
assert resp.status_code == 302
assert resp.headers['Location'] == '/hub/spawn'
assert resp.headers["Location"] == "/hub/spawn"
def test_post_install_hook():