summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-30 17:42:13 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-03-31 13:10:09 +0200
commit40c72f849d35cde1644558792845d93e3032ea93 (patch)
tree496ac48eaca20cc2a5823cc2da3a28baf4122202 /tests
parentd850d3d13fe2c916738d4202408b042cebfac294 (diff)
downloadqutebrowser-40c72f849d35cde1644558792845d93e3032ea93.tar.gz
qutebrowser-40c72f849d35cde1644558792845d93e3032ea93.zip
flatpak: Skip download dispatcher tests
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py4
-rw-r--r--tests/end2end/features/downloads.feature8
-rw-r--r--tests/unit/utils/test_utils.py10
3 files changed, 20 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 6275cdd02..40631af34 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -93,6 +93,10 @@ def _apply_platform_markers(config, item):
pytest.mark.skipif,
getattr(sys, 'frozen', False),
"Can't be run when frozen"),
+ ('not_flatpak',
+ pytest.mark.skipif,
+ version.is_flatpak(),
+ "Can't be run with Flatpak"),
('frozen',
pytest.mark.skipif,
not getattr(sys, 'frozen', False),
diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature
index 1433f4c0a..dfdb24704 100644
--- a/tests/end2end/features/downloads.feature
+++ b/tests/end2end/features/downloads.feature
@@ -290,6 +290,7 @@ Feature: Downloading things from a website.
And I wait for "File successfully written." in the log
Then the downloaded file Test title.mhtml should exist
+ @not_flatpak
Scenario: Opening a mhtml download directly
When I set downloads.location.prompt to true
And I open /
@@ -404,18 +405,21 @@ Feature: Downloading things from a website.
## :download-open
+ @not_flatpak
Scenario: Opening a download
When I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I open the download
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with a placeholder
When I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I open the download with a placeholder
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with open_dispatcher set
When I set a test python open_dispatcher
And I open data/downloads/download.bin without waiting
@@ -423,6 +427,7 @@ Feature: Downloading things from a website.
And I run :download-open
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with open_dispatcher set and override
When I set downloads.open_dispatcher to cat
And I open data/downloads/download.bin without waiting
@@ -446,6 +451,7 @@ Feature: Downloading things from a website.
## opening a file directly (prompt-open-download)
+ @not_flatpak
Scenario: Opening a download directly
When I set downloads.location.prompt to true
And I open data/downloads/download.bin without waiting
@@ -466,6 +472,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/1725
+ @not_flatpak
Scenario: Directly open a download with a very long filename
When I set downloads.location.prompt to true
And I open data/downloads/issue1725.html
@@ -530,6 +537,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/2173
+ @not_flatpak
Scenario: Remembering the temporary download directory (issue 2173)
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index a935c7607..9622fe2eb 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -715,6 +715,7 @@ class TestGetSetClipboard:
class TestOpenFile:
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_cmdline_without_argument(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass'.format(executable)
@@ -724,6 +725,7 @@ class TestOpenFile:
r'Opening /foo/bar with \[.*python.*/foo/bar.*\]', result)
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_cmdline_with_argument(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass {{}} raboof'.format(executable)
@@ -733,6 +735,7 @@ class TestOpenFile:
r"Opening /foo/bar with \[.*python.*/foo/bar.*'raboof'\]", result)
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_setting_override(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass'.format(executable)
@@ -762,8 +765,11 @@ class TestOpenFile:
parsed=version.Distribution.kde_flatpak,
version=VersionNumber.parse('5.12'),
pretty='Unknown')
- monkeypatch.setattr(version, 'distribution',
- lambda: info)
+
+ if not version.is_flatpak():
+ monkeypatch.setattr(version, 'distribution', lambda: info)
+
+ assert version.is_flatpak()
def test_cmdline_sandboxed(self, sandbox_patch,
config_stub, message_mock, caplog):