mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53: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)
|
||||
|
||||
|
||||
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):
|
||||
to_load = {
|
||||
'blue': ['cyclops', 'rogue', 'wolverine'],
|
||||
|
Reference in New Issue
Block a user