From f230919bbfe7951647de1d5823553ddfc5575e4f Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 23 May 2023 11:02:19 +0200 Subject: [PATCH] verify rejected auth as well --- tests/test_api.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_api.py b/tests/test_api.py index 55172ca9..d5cb1c31 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -118,6 +118,23 @@ def test_clone_default(jupyterdir, jupyter_server): assert os.path.isdir(os.path.join(target_path, '.git')) +def test_clone_auth(jupyterdir, jupyter_server): + """ + Tests use of 'repo' and 'branch' parameters. + """ + with Remote() as remote, Pusher(remote) as pusher: + pusher.push_file('README.md', 'Testing some content') + print(f'path: {remote.path}') + params = { + 'repo': remote.path, + 'branch': 'master', + 'token': 'wrong', + } + r = request_api(params) + # no token, redirect to login + assert r.code == 302 + + def test_clone_targetpath(jupyterdir, jupyter_server): """ Tests use of 'targetpath' parameter.