From 17bece3bddcc46c33b4b647bf9f4273c80ad0e0e Mon Sep 17 00:00:00 2001 From: meejah Date: Tue, 30 Aug 2022 18:00:57 -0600 Subject: [PATCH] test permissions config --- src/wormhole_mailbox_server/test/test_config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wormhole_mailbox_server/test/test_config.py b/src/wormhole_mailbox_server/test/test_config.py index 3ca7853..8190aaa 100644 --- a/src/wormhole_mailbox_server/test/test_config.py +++ b/src/wormhole_mailbox_server/test/test_config.py @@ -219,3 +219,16 @@ def test_string(self): self.assertIn("--blur-usage=", s) self.assertIn("round logged access times to improve privacy", s) + def test_permissions_valid(self): + o = server_tap.Options() + o.parseOptions([ + "--permissions", "none", + ]) + self.assertEquals(o["permissions"], "none") + + def test_permissions_invalid(self): + o = server_tap.Options() + with self.assertRaises(UsageError): + o.parseOptions([ + "--permissions", "an invalid permission method", + ])