qutebrowser/tests/helpers
Philipp Albrecht ff6668f295 Generalize (testdata) substitution in end2end tests
We replace the `(testdata)` placeholder with `testutils.abs_datapath()` in a few end2end
tests. So far we only needed to replace `(testdata)` with an OS path (e.g. in
`tests/end2end/features/spawn.feature`). By introducing `(testdata)` to an end2end test
in `tests/end2end/features/hints.feature`, we required a new use case: replacing
`(testdata)` as part of a valid file:// URI.

```
When I open file://(testdata)/some/file.txt
```

Replacing `(testdata)` in above BDD step with a plain OS path resulted in invalid URIs,
e.g. for the path "C:\\Users" above BDD step results in this invalid URI:

```
When I open file://C:\Users/some/file.txt
```

We deal with this by first isolating the `(testdata)` substitution in a single place.
Having `(testdata)` substitutions in a single place, we simply special-case the substitution
of file:// paths, which will be part of a URI.
Successful substitution for above BDD step looks like the following:

```
When I open file:///C:/Users/some/file.txt
```
2023-09-05 12:20:02 +02:00
..
fixtures.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
logfail.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
messagemock.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
stubs.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_helper_utils.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_logfail.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
test_stubs.py reuse: Initial copyright text update for myself 2023-07-23 12:49:05 +02:00
testutils.py Generalize (testdata) substitution in end2end tests 2023-09-05 12:20:02 +02:00