diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-15 11:09:32 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-24 21:28:55 +0100 |
commit | 143db4f9d3cb4bd4f6952c89f921ce6d277c9533 (patch) | |
tree | c18722f3e0da6059fe9ac94fdc7a3b78d83f938e | |
parent | da0a1afad2a71a01e7665dd8eada834c98a23345 (diff) | |
download | qutebrowser-143db4f9d3cb4bd4f6952c89f921ce6d277c9533.tar.gz qutebrowser-143db4f9d3cb4bd4f6952c89f921ce6d277c9533.zip |
tests: Don't download TLD list
(cherry picked from commit 9303e6a85489775f63b5d15b7bbd3173f74764d9)
-rwxr-xr-x | misc/userscripts/qute-lastpass | 9 | ||||
-rw-r--r-- | tests/unit/misc/userscripts/test_qute_lastpass.py | 1 |
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 |