mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
Test setting cookie_secret to a hexadecimal string
This commit is contained in:
@@ -199,6 +199,18 @@ def test_cookie_secret_env(tmpdir, request):
|
|||||||
assert not os.path.exists(hub.cookie_secret_file)
|
assert not os.path.exists(hub.cookie_secret_file)
|
||||||
|
|
||||||
|
|
||||||
|
def test_cookie_secret_string_():
|
||||||
|
cfg = Config()
|
||||||
|
|
||||||
|
cfg.JupyterHub.cookie_secret = "not hex"
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
JupyterHub(config=cfg)
|
||||||
|
|
||||||
|
cfg.JupyterHub.cookie_secret = "abc123"
|
||||||
|
app = JupyterHub(config=cfg)
|
||||||
|
assert app.cookie_secret == binascii.a2b_hex('abc123')
|
||||||
|
|
||||||
|
|
||||||
async def test_load_groups(tmpdir, request):
|
async def test_load_groups(tmpdir, request):
|
||||||
to_load = {
|
to_load = {
|
||||||
'blue': ['cyclops', 'rogue', 'wolverine'],
|
'blue': ['cyclops', 'rogue', 'wolverine'],
|
||||||
|
Reference in New Issue
Block a user