aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-12-03 00:00:00 +0000
committerjahoti <jahoti@tilde.team>2021-12-03 00:00:00 +0000
commit3fcff3382d439c0451421288f1d7d942be0de0c8 (patch)
tree33d7dd06621d544a54d7ae6acffb89f7030293ef /test
parentd16e763e240a2aefe3d4490cddff61893a35a1ea (diff)
downloadbrowser-extension-3fcff3382d439c0451421288f1d7d942be0de0c8.tar.gz
browser-extension-3fcff3382d439c0451421288f1d7d942be0de0c8.zip
Make testing configurable
Add options to configure in accordance with #97
Diffstat (limited to 'test')
-rw-r--r--test/misc_constants.py23
1 files changed, 23 insertions, 0 deletions
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",