Completed
Pull Request — master (#208)
by Jace
03:30
created

test_samples()   A

Complexity

Conditions 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
c 2
b 0
f 0
dl 0
loc 13
rs 9.4285
1
# pylint: disable=bad-continuation
2
3
from pathlib import Path
4
5
6
SAMPLES = Path(__file__).parent.joinpath("samples")
7
8
9
def test_samples(client):
10
    """Create various sample images for manual verfification."""
11
    for name, url in [
12
        ("basic.jpg", "/ch/hello/world.jpg"),
13
        ("nominal.jpg", "/ch/a-normal-line-of-top-meme-text-followed-by/"
14
            "another-normal-line-of-bottom-meme-text.jpg"),
15
        ("long.jpg", "/ch/" + ("long-" * 15) + "line/short-line.jpg"),
16
        ("subscripts.jpg", "/ch/some-unicode-subscripts/h%E2%82%82o.jpg"),
17
    ]:
18
        with SAMPLES.joinpath(name).open('wb') as image:
0 ignored issues
show
Bug introduced by
The Instance of PurePath does not seem to have a member named open.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
19
            response = client.get(url)
20
            data = response.get_data()
21
            image.write(data)
22