tests.test_latest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A describe_latest() 0 17 1
1
# pylint: disable=unused-variable,expression-not-assigned
2
3
from expecter import expect
0 ignored issues
show
introduced by
Unable to import 'expecter'
Loading history...
4
5
6
def describe_latest():
7
8
    def it_returns_filtered_images_by_default(client):
9
        response = client.get("/latest")
10
11
        expect(response.status_code) == 200
12
        expect(response.mimetype) == 'text/html'
13
        expect(response.get_data(as_text=True)).contains(
14
            'src="/latest1.jpg?filtered=true&')
15
16
    def it_returns_unfiltered_images_when_nsfw(client):
17
        response = client.get("/latest?nsfw=true")
18
19
        expect(response.status_code) == 200
20
        expect(response.mimetype) == 'text/html'
21
        expect(response.get_data(as_text=True)).contains(
22
            'src="/latest1.jpg?filtered=false&')
23