diff options
author | Árni Dagur <agudmundsson@fc-md.umd.edu> | 2020-05-24 15:56:06 -0400 |
---|---|---|
committer | Árni Dagur <arni@dagur.eu> | 2020-12-19 20:23:17 +0000 |
commit | 18db146b74d7e67da9dea2a1be8db533f920d51f (patch) | |
tree | 4673093b0a500960e7376d146bb44e24e8d862fe /tests/helpers | |
parent | fa76f013ea5ac6907ed8ed0ca234597394d98e3b (diff) | |
download | qutebrowser-18db146b74d7e67da9dea2a1be8db533f920d51f.tar.gz qutebrowser-18db146b74d7e67da9dea2a1be8db533f920d51f.zip |
Compress data files for 'test_braveadblock.py'
Diffstat (limited to 'tests/helpers')
-rw-r--r-- | tests/helpers/utils.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/helpers/utils.py b/tests/helpers/utils.py index 25c3fb9a1..1d3f0bfac 100644 --- a/tests/helpers/utils.py +++ b/tests/helpers/utils.py @@ -196,6 +196,22 @@ def ignore_bs4_warning(): yield +def _decompress_gzip_datafile(filename): + path = os.path.join(abs_datapath(), filename) + yield from io.TextIOWrapper(gzip.open(path), encoding="utf-8") + + def blocked_hosts(): - path = os.path.join(abs_datapath(), 'blocked-hosts.gz') - yield from io.TextIOWrapper(gzip.open(path), encoding='utf-8') + return _decompress_gzip_datafile("blocked-hosts.gz") + + +def adblock_dataset_tsv(): + return _decompress_gzip_datafile("adblock_dataset.tsv.gz") + + +def easylist_txt(): + return _decompress_gzip_datafile("easylist.txt.gz") + + +def easyprivacy_txt(): + return _decompress_gzip_datafile("easyprivacy.txt.gz") |