diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/haketilo_test/__init__.py (renamed from test/__init__.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/__main__.py (renamed from test/__main__.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/conftest.py (renamed from test/conftest.py) | 4 | ||||
-rw-r--r-- | test/haketilo_test/data/pages/gotmyowndomain.html (renamed from test/data/pages/gotmyowndomain.html) | 0 | ||||
-rw-r--r-- | test/haketilo_test/data/pages/gotmyowndomain_https.html (renamed from test/data/pages/gotmyowndomain_https.html) | 0 | ||||
-rw-r--r-- | test/haketilo_test/data/pages/scripts_to_block_1.html (renamed from test/data/pages/scripts_to_block_1.html) | 0 | ||||
-rw-r--r-- | test/haketilo_test/default_profiles/icecat_empty/extensions.json (renamed from test/default_profiles/icecat_empty/extensions.json) | 0 | ||||
-rw-r--r-- | test/haketilo_test/extension_crafting.py (renamed from test/extension_crafting.py) | 4 | ||||
-rw-r--r-- | test/haketilo_test/misc_constants.py (renamed from test/misc_constants.py) | 6 | ||||
-rwxr-xr-x | test/haketilo_test/profiles.py (renamed from test/profiles.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/proxy_core.py (renamed from test/proxy_core.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/script_loader.py (renamed from test/script_loader.py) | 4 | ||||
-rwxr-xr-x | test/haketilo_test/server.py (renamed from test/server.py) | 3 | ||||
-rw-r--r-- | test/haketilo_test/test_integration.py (renamed from test/test_integration.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/__init__.py (renamed from test/unit/__init__.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_CORS_bypass_server.py (renamed from test/unit/test_CORS_bypass_server.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_basic.py (renamed from test/unit/test_basic.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_broadcast.py (renamed from test/unit/test_broadcast.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_content.py (renamed from test/unit/test_content.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_default_policy_dialog.py (renamed from test/unit/test_default_policy_dialog.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_dialog.py (renamed from test/unit/test_dialog.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_indexeddb.py (renamed from test/unit/test_indexeddb.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_indexeddb_files_server.py (renamed from test/unit/test_indexeddb_files_server.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_install.py (renamed from test/unit/test_install.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_item_list.py (renamed from test/unit/test_item_list.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_item_preview.py (renamed from test/unit/test_item_preview.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_patterns.py (renamed from test/unit/test_patterns.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_patterns_query_manager.py (renamed from test/unit/test_patterns_query_manager.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_patterns_query_tree.py (renamed from test/unit/test_patterns_query_tree.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_payload_create.py (renamed from test/unit/test_payload_create.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_policy_deciding.py (renamed from test/unit/test_policy_deciding.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_policy_enforcing.py (renamed from test/unit/test_policy_enforcing.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_popup.py (renamed from test/unit/test_popup.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_repo_query.py (renamed from test/unit/test_repo_query.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_repo_query_cacher.py (renamed from test/unit/test_repo_query_cacher.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_settings.py (renamed from test/unit/test_settings.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_text_entry_list.py (renamed from test/unit/test_text_entry_list.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/test_webrequest.py (renamed from test/unit/test_webrequest.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/unit/utils.py (renamed from test/unit/utils.py) | 0 | ||||
-rw-r--r-- | test/haketilo_test/world_wide_library.py (renamed from test/world_wide_library.py) | 2 |
40 files changed, 12 insertions, 11 deletions
diff --git a/test/__init__.py b/test/haketilo_test/__init__.py index 2b351bb..2b351bb 100644 --- a/test/__init__.py +++ b/test/haketilo_test/__init__.py diff --git a/test/__main__.py b/test/haketilo_test/__main__.py index 7afda55..7afda55 100644 --- a/test/__main__.py +++ b/test/haketilo_test/__main__.py diff --git a/test/conftest.py b/test/haketilo_test/conftest.py index c0ece61..9103ac8 100644 --- a/test/conftest.py +++ b/test/haketilo_test/conftest.py @@ -36,7 +36,7 @@ from .profiles import firefox_safe_mode from .server import do_an_internet from .extension_crafting import make_extension from .world_wide_library import start_serving_script, dump_scripts -from .misc_constants import here +from .misc_constants import proj_root @pytest.fixture(scope="session") def proxy(): @@ -108,7 +108,7 @@ def webextension(driver, request): @pytest.fixture() def haketilo(driver): - addon_id = driver.install_addon(str(here.parent / 'mozilla-build.zip'), + addon_id = driver.install_addon(str(Path.cwd() / 'mozilla-build.zip'), temporary=True) yield diff --git a/test/data/pages/gotmyowndomain.html b/test/haketilo_test/data/pages/gotmyowndomain.html index 390cbcc..390cbcc 100644 --- a/test/data/pages/gotmyowndomain.html +++ b/test/haketilo_test/data/pages/gotmyowndomain.html diff --git a/test/data/pages/gotmyowndomain_https.html b/test/haketilo_test/data/pages/gotmyowndomain_https.html index f602950..f602950 100644 --- a/test/data/pages/gotmyowndomain_https.html +++ b/test/haketilo_test/data/pages/gotmyowndomain_https.html diff --git a/test/data/pages/scripts_to_block_1.html b/test/haketilo_test/data/pages/scripts_to_block_1.html index 164979d..164979d 100644 --- a/test/data/pages/scripts_to_block_1.html +++ b/test/haketilo_test/data/pages/scripts_to_block_1.html diff --git a/test/default_profiles/icecat_empty/extensions.json b/test/haketilo_test/default_profiles/icecat_empty/extensions.json index 5f74ff3..5f74ff3 100644 --- a/test/default_profiles/icecat_empty/extensions.json +++ b/test/haketilo_test/default_profiles/icecat_empty/extensions.json diff --git a/test/extension_crafting.py b/test/haketilo_test/extension_crafting.py index 680c45e..97f5027 100644 --- a/test/extension_crafting.py +++ b/test/haketilo_test/extension_crafting.py @@ -106,11 +106,11 @@ class ExtraHTML: ['awk', '-f', awk_script_name, '--', *unit_test_defines, *append_flags, '-H', self.html_path, '--write-js-deps', '--output=files-to-copy', f'--output-dir={tmpdir}'], - stdout=subprocess.PIPE, cwd=script_root, check=True + stdout=subprocess.PIPE, cwd=proj_root, check=True ) for path in filter(None, awk.stdout.decode().split('\n')): - xpi.write(script_root / path, path) + xpi.write(proj_root / path, path) tmpdir = Path(tmpdir) for path in tmpdir.rglob('*'): diff --git a/test/misc_constants.py b/test/haketilo_test/misc_constants.py index 96bc9e0..9cac9dc 100644 --- a/test/misc_constants.py +++ b/test/haketilo_test/misc_constants.py @@ -31,7 +31,7 @@ import re from pathlib import Path here = Path(__file__).resolve().parent -script_root = here.parent +proj_root = here.parent.parent awk_script_name = 'compute_scripts.awk' unit_test_defines = ['-D', 'MOZILLA', '-D', 'MV2', '-D', 'TEST', @@ -39,7 +39,7 @@ unit_test_defines = ['-D', 'MOZILLA', '-D', 'MV2', '-D', 'TEST', conf_line_regex = re.compile(r'^([^=]+) = (.*)$') conf_settings = {} -with open(here.parent / 'record.conf', 'rt') as conf: +with open(Path.cwd() / 'record.conf', 'rt') as conf: for line in conf.readlines(): match = conf_line_regex.match(line) if match: @@ -48,7 +48,7 @@ with open(here.parent / 'record.conf', 'rt') as conf: default_proxy_host = '127.0.0.1' default_proxy_port = 1337 -default_cert_dir = here / 'certs' +default_cert_dir = proj_root / 'test' / 'certs' default_extension_uuid = 'a1291446-be95-48ad-a4c6-a475e389399b' default_haketilo_id = '{6fe13369-88e9-440f-b837-5012fb3bedec}' diff --git a/test/profiles.py b/test/haketilo_test/profiles.py index ae997fc..ae997fc 100755 --- a/test/profiles.py +++ b/test/haketilo_test/profiles.py diff --git a/test/proxy_core.py b/test/haketilo_test/proxy_core.py index f6bb820..f6bb820 100644 --- a/test/proxy_core.py +++ b/test/haketilo_test/proxy_core.py diff --git a/test/script_loader.py b/test/haketilo_test/script_loader.py index cc73d4c..66130bb 100644 --- a/test/script_loader.py +++ b/test/haketilo_test/script_loader.py @@ -34,7 +34,7 @@ def make_relative_path(path): path = Path(path) if path.is_absolute(): - path = path.relative_to(script_root) + path = path.relative_to(proj_root) return path @@ -65,7 +65,7 @@ def load_script(path, code_to_add=None): awk = subprocess.run(['awk', '-f', awk_script_name, '--', *unit_test_defines, *append_flags, '--output=amalgamate-js:' + str(path)], - stdout=subprocess.PIPE, cwd=script_root, check=True) + stdout=subprocess.PIPE, cwd=proj_root, check=True) script = awk.stdout.decode() script_cache[key] = script diff --git a/test/server.py b/test/haketilo_test/server.py index 0963b5b..7dc5e9e 100755 --- a/test/server.py +++ b/test/haketilo_test/server.py @@ -99,7 +99,8 @@ class RequestHijacker(ProxyRequestHandler): if resp_body: self.wfile.write(resp_body) -def do_an_internet(certdir=default_cert_dir, port=default_proxy_port): +def do_an_internet(certdir=Path.cwd() / 'certs', + port=default_proxy_port): """Start up the proxy/server""" class RequestHijackerWithCertdir(RequestHijacker): def __init__(self, *args, **kwargs): diff --git a/test/test_integration.py b/test/haketilo_test/test_integration.py index 87d1827..87d1827 100644 --- a/test/test_integration.py +++ b/test/haketilo_test/test_integration.py diff --git a/test/unit/__init__.py b/test/haketilo_test/unit/__init__.py index 2b351bb..2b351bb 100644 --- a/test/unit/__init__.py +++ b/test/haketilo_test/unit/__init__.py diff --git a/test/unit/test_CORS_bypass_server.py b/test/haketilo_test/unit/test_CORS_bypass_server.py index 45e4ebb..45e4ebb 100644 --- a/test/unit/test_CORS_bypass_server.py +++ b/test/haketilo_test/unit/test_CORS_bypass_server.py diff --git a/test/unit/test_basic.py b/test/haketilo_test/unit/test_basic.py index 6ec54cc..6ec54cc 100644 --- a/test/unit/test_basic.py +++ b/test/haketilo_test/unit/test_basic.py diff --git a/test/unit/test_broadcast.py b/test/haketilo_test/unit/test_broadcast.py index 7c2c051..7c2c051 100644 --- a/test/unit/test_broadcast.py +++ b/test/haketilo_test/unit/test_broadcast.py diff --git a/test/unit/test_content.py b/test/haketilo_test/unit/test_content.py index 8220160..8220160 100644 --- a/test/unit/test_content.py +++ b/test/haketilo_test/unit/test_content.py diff --git a/test/unit/test_default_policy_dialog.py b/test/haketilo_test/unit/test_default_policy_dialog.py index a1c825f..a1c825f 100644 --- a/test/unit/test_default_policy_dialog.py +++ b/test/haketilo_test/unit/test_default_policy_dialog.py diff --git a/test/unit/test_dialog.py b/test/haketilo_test/unit/test_dialog.py index 63af79e..63af79e 100644 --- a/test/unit/test_dialog.py +++ b/test/haketilo_test/unit/test_dialog.py diff --git a/test/unit/test_indexeddb.py b/test/haketilo_test/unit/test_indexeddb.py index c2d5427..c2d5427 100644 --- a/test/unit/test_indexeddb.py +++ b/test/haketilo_test/unit/test_indexeddb.py diff --git a/test/unit/test_indexeddb_files_server.py b/test/haketilo_test/unit/test_indexeddb_files_server.py index 6ddfba8..6ddfba8 100644 --- a/test/unit/test_indexeddb_files_server.py +++ b/test/haketilo_test/unit/test_indexeddb_files_server.py diff --git a/test/unit/test_install.py b/test/haketilo_test/unit/test_install.py index f4bc483..f4bc483 100644 --- a/test/unit/test_install.py +++ b/test/haketilo_test/unit/test_install.py diff --git a/test/unit/test_item_list.py b/test/haketilo_test/unit/test_item_list.py index 35ed1d5..35ed1d5 100644 --- a/test/unit/test_item_list.py +++ b/test/haketilo_test/unit/test_item_list.py diff --git a/test/unit/test_item_preview.py b/test/haketilo_test/unit/test_item_preview.py index fe9a98e..fe9a98e 100644 --- a/test/unit/test_item_preview.py +++ b/test/haketilo_test/unit/test_item_preview.py diff --git a/test/unit/test_patterns.py b/test/haketilo_test/unit/test_patterns.py index f2eeaf8..f2eeaf8 100644 --- a/test/unit/test_patterns.py +++ b/test/haketilo_test/unit/test_patterns.py diff --git a/test/unit/test_patterns_query_manager.py b/test/haketilo_test/unit/test_patterns_query_manager.py index 9fbc438..9fbc438 100644 --- a/test/unit/test_patterns_query_manager.py +++ b/test/haketilo_test/unit/test_patterns_query_manager.py diff --git a/test/unit/test_patterns_query_tree.py b/test/haketilo_test/unit/test_patterns_query_tree.py index 80bf554..80bf554 100644 --- a/test/unit/test_patterns_query_tree.py +++ b/test/haketilo_test/unit/test_patterns_query_tree.py diff --git a/test/unit/test_payload_create.py b/test/haketilo_test/unit/test_payload_create.py index 9689c37..9689c37 100644 --- a/test/unit/test_payload_create.py +++ b/test/haketilo_test/unit/test_payload_create.py diff --git a/test/unit/test_policy_deciding.py b/test/haketilo_test/unit/test_policy_deciding.py index 75b35ac..75b35ac 100644 --- a/test/unit/test_policy_deciding.py +++ b/test/haketilo_test/unit/test_policy_deciding.py diff --git a/test/unit/test_policy_enforcing.py b/test/haketilo_test/unit/test_policy_enforcing.py index 4b7c173..4b7c173 100644 --- a/test/unit/test_policy_enforcing.py +++ b/test/haketilo_test/unit/test_policy_enforcing.py diff --git a/test/unit/test_popup.py b/test/haketilo_test/unit/test_popup.py index 1fc262c..1fc262c 100644 --- a/test/unit/test_popup.py +++ b/test/haketilo_test/unit/test_popup.py diff --git a/test/unit/test_repo_query.py b/test/haketilo_test/unit/test_repo_query.py index c8c4875..c8c4875 100644 --- a/test/unit/test_repo_query.py +++ b/test/haketilo_test/unit/test_repo_query.py diff --git a/test/unit/test_repo_query_cacher.py b/test/haketilo_test/unit/test_repo_query_cacher.py index 5fbc5cd..5fbc5cd 100644 --- a/test/unit/test_repo_query_cacher.py +++ b/test/haketilo_test/unit/test_repo_query_cacher.py diff --git a/test/unit/test_settings.py b/test/haketilo_test/unit/test_settings.py index 7cdb76f..7cdb76f 100644 --- a/test/unit/test_settings.py +++ b/test/haketilo_test/unit/test_settings.py diff --git a/test/unit/test_text_entry_list.py b/test/haketilo_test/unit/test_text_entry_list.py index 3135a59..3135a59 100644 --- a/test/unit/test_text_entry_list.py +++ b/test/haketilo_test/unit/test_text_entry_list.py diff --git a/test/unit/test_webrequest.py b/test/haketilo_test/unit/test_webrequest.py index fb24b3d..fb24b3d 100644 --- a/test/unit/test_webrequest.py +++ b/test/haketilo_test/unit/test_webrequest.py diff --git a/test/unit/utils.py b/test/haketilo_test/unit/utils.py index b27a209..b27a209 100644 --- a/test/unit/utils.py +++ b/test/haketilo_test/unit/utils.py diff --git a/test/world_wide_library.py b/test/haketilo_test/world_wide_library.py index 1e802ab..1eb826e 100644 --- a/test/world_wide_library.py +++ b/test/haketilo_test/world_wide_library.py @@ -75,7 +75,7 @@ def serve_script(command, get_params, post_params): return 200, {'Content-Type': 'application/javascript'}, script -def dump_scripts(directory='./injected_scripts'): +def dump_scripts(directory=(Path.cwd() / 'injected_scripts')): """ Write all scripts that have been registered with start_serving_script() under the provided directory. If the directory already exists, it is wiped |