From 3fcff3382d439c0451421288f1d7d942be0de0c8 Mon Sep 17 00:00:00 2001 From: jahoti Date: Fri, 3 Dec 2021 00:00:00 +0000 Subject: Make testing configurable Add options to configure in accordance with #97 --- test/misc_constants.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/misc_constants.py b/test/misc_constants.py index 22432a6..55ee13e 100644 --- a/test/misc_constants.py +++ b/test/misc_constants.py @@ -41,6 +41,29 @@ default_proxy_port = 1337 default_cert_dir = here / 'certs' +# Use user-specified values instead where available +try: + with open(str(here.parent / 'testing.conf')) as f: + option = f.readline() + while ' ' in option: + key, value = option[:-1].split(' ', maxsplit=1) + if key == 'BINARY': + default_firefox_binary = value + + elif key == 'TEST_PROFILE': + default_clean_profile_dir = value + + elif key == 'TEST_PORT': + default_proxy_port = value + + else: + raise KeyError(key) + + option = f.readline() +except FileNotFoundError: + # There may be no defaults overridden; that's OK! + pass + mime_types = { "7z": "application/x-7z-compressed", "oga": "audio/ogg", "abw": "application/x-abiword", "ogv": "video/ogg", -- cgit v1.2.3