Passed
Push — master ( 985ebe...85a50e )
by Jace
01:21
created

describe_latest()   A

Complexity

Conditions 3

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
cc 3
c 5
b 0
f 0
dl 0
loc 17
rs 9.4285

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_returns_unfiltered_images_when_nsfw() 0 7 1
A it_returns_filtered_images_by_default() 0 7 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