From 9f10fa105c05ff6d15babe4abbdbad2282229f50 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Oct 2017 13:42:04 +0200 Subject: [PATCH] Merge adblock.feature into misc.feature --- tests/end2end/features/adblock.feature | 8 ------ tests/end2end/features/misc.feature | 5 ++++ tests/end2end/features/test_adblock_bdd.py | 31 ---------------------- tests/end2end/features/test_misc_bdd.py | 9 +++++++ 4 files changed, 14 insertions(+), 39 deletions(-) delete mode 100644 tests/end2end/features/adblock.feature delete mode 100644 tests/end2end/features/test_adblock_bdd.py diff --git a/tests/end2end/features/adblock.feature b/tests/end2end/features/adblock.feature deleted file mode 100644 index c400df25f..000000000 --- a/tests/end2end/features/adblock.feature +++ /dev/null @@ -1,8 +0,0 @@ -# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et: - -Feature: Ad blocking - - Scenario: Simple adblock update - When I set up "simple" as block lists - And I run :adblock-update - Then the message "adblock: Read 1 hosts from 1 sources." should be shown diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 97f15bf90..9d8204b63 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -527,3 +527,8 @@ Feature: Various utility commands. And I wait for "Renderer process was killed" in the log And I open data/numbers/3.txt Then no crash should happen + + Scenario: Simple adblock update + When I set up "simple" as block lists + And I run :adblock-update + Then the message "adblock: Read 1 hosts from 1 sources." should be shown diff --git a/tests/end2end/features/test_adblock_bdd.py b/tests/end2end/features/test_adblock_bdd.py deleted file mode 100644 index 780e55a59..000000000 --- a/tests/end2end/features/test_adblock_bdd.py +++ /dev/null @@ -1,31 +0,0 @@ -# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: - -# Copyright 2016-2017 Florian Bruhin (The Compiler) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . - -import json - -import pytest_bdd as bdd - -bdd.scenarios('adblock.feature') - - -@bdd.when(bdd.parsers.parse('I set up "{lists}" as block lists')) -def set_up_blocking(quteproc, lists, server): - url = 'http://localhost:{}/data/adblock/'.format(server.port) - urls = [url + item.strip() for item in lists.split(',')] - quteproc.set_setting('content.host_blocking.lists', json.dumps(urls)) diff --git a/tests/end2end/features/test_misc_bdd.py b/tests/end2end/features/test_misc_bdd.py index d8e2fd07e..19d94ce6a 100644 --- a/tests/end2end/features/test_misc_bdd.py +++ b/tests/end2end/features/test_misc_bdd.py @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . +import json + import pytest_bdd as bdd bdd.scenarios('misc.feature') @@ -26,3 +28,10 @@ def pdf_exists(quteproc, tmpdir, filename): path = tmpdir / filename data = path.read_binary() assert data.startswith(b'%PDF') + + +@bdd.when(bdd.parsers.parse('I set up "{lists}" as block lists')) +def set_up_blocking(quteproc, lists, server): + url = 'http://localhost:{}/data/adblock/'.format(server.port) + urls = [url + item.strip() for item in lists.split(',')] + quteproc.set_setting('content.host_blocking.lists', json.dumps(urls))