From 6efa5f15b731a8eea25932504bc8c8e564f2a3bc Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 16 Sep 2018 14:18:44 +1000 Subject: [PATCH] Fix public mode tests for 404 --- test/test_onionshare_web.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_onionshare_web.py b/test/test_onionshare_web.py index 0819010a..2209a0fd 100644 --- a/test/test_onionshare_web.py +++ b/test/test_onionshare_web.py @@ -173,14 +173,15 @@ class TestWeb: common_obj.settings.set('public_mode', True) with web.app.test_client() as c: - # Upload page should be accessible from both / and /[slug] + # Upload page should be accessible from / res = c.get('/') data1 = res.get_data() assert res.status_code == 200 + # /[slug] should be a 404 res = c.get('/{}'.format(web.slug)) data2 = res.get_data() - assert res.status_code == 200 + assert res.status_code == 404 def test_public_mode_off(self, common_obj): web = web_obj(common_obj, True) @@ -192,7 +193,7 @@ class TestWeb: data1 = res.get_data() assert res.status_code == 404 - # Upload page should be accessible from both /[slug] + # Upload page should be accessible from /[slug] res = c.get('/{}'.format(web.slug)) data2 = res.get_data() assert res.status_code == 200