summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-15 11:09:32 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-24 21:28:55 +0100
commit143db4f9d3cb4bd4f6952c89f921ce6d277c9533 (patch)
treec18722f3e0da6059fe9ac94fdc7a3b78d83f938e
parentda0a1afad2a71a01e7665dd8eada834c98a23345 (diff)
downloadqutebrowser-143db4f9d3cb4bd4f6952c89f921ce6d277c9533.tar.gz
qutebrowser-143db4f9d3cb4bd4f6952c89f921ce6d277c9533.zip
tests: Don't download TLD list
(cherry picked from commit 9303e6a85489775f63b5d15b7bbd3173f74764d9)
-rwxr-xr-xmisc/userscripts/qute-lastpass9
-rw-r--r--tests/unit/misc/userscripts/test_qute_lastpass.py1
2 files changed, 9 insertions, 1 deletions
diff --git a/misc/userscripts/qute-lastpass b/misc/userscripts/qute-lastpass
index ac9783641..d2a72f077 100755
--- a/misc/userscripts/qute-lastpass
+++ b/misc/userscripts/qute-lastpass
@@ -60,6 +60,8 @@ argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
help='Encoding used to communicate with subprocesses')
argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
help='Merge pass candidates for fully-qualified and registered domain name')
+argument_parser.add_argument('--no-tld-download', action='store_true',
+ help="Don't download TLD list")
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e',
action='store_true', help='Only insert username')
@@ -117,7 +119,12 @@ def main(arguments):
argument_parser.print_help()
return ExitCodes.FAILURE
- extract_result = tldextract.extract(arguments.url)
+ if arguments.no_tld_download:
+ extract = tldextract.TLDExtract(suffix_list_urls=None)
+ else:
+ extract = tldextract.extract
+
+ extract_result = extract(arguments.url)
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name and finally: the IPv4 address if that's what
diff --git a/tests/unit/misc/userscripts/test_qute_lastpass.py b/tests/unit/misc/userscripts/test_qute_lastpass.py
index 3846028ee..24272a048 100644
--- a/tests/unit/misc/userscripts/test_qute_lastpass.py
+++ b/tests/unit/misc/userscripts/test_qute_lastpass.py
@@ -79,6 +79,7 @@ def arguments_mock():
arguments.merge_candidates = False
arguments.password_only = False
arguments.username_only = False
+ arguments.no_tld_download = True
return arguments