1 | # pylint: disable=unused-variable,misplaced-comparison-constant,expression-not-assigned |
||
2 | |||
3 | from expecter import expect |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
4 | |||
5 | from .utils import load |
||
6 | |||
7 | |||
8 | def describe_get(): |
||
9 | |||
10 | def it_redirects_with_param(client): |
||
11 | status, data = load(client.get("/api/aliases/?name=foo")) |
||
12 | |||
13 | expect(status) == 302 |
||
14 | expect(data).contains('<a href="/api/aliases/foo">') |
||
15 | |||
16 | def describe_filter(): |
||
17 | |||
18 | def with_single_match(client): |
||
19 | status, data = load(client.get("/api/aliases/sad-biden")) |
||
20 | |||
21 | expect(status) == 200 |
||
22 | expect(data) == { |
||
23 | 'sad-biden': { |
||
24 | 'styles': [ |
||
25 | 'down', |
||
26 | 'scowl', |
||
27 | 'window', |
||
28 | ], |
||
29 | 'template': "http://localhost/api/templates/sad-biden" |
||
30 | } |
||
31 | } |
||
32 | |||
33 | def with_many_matches(client): |
||
34 | status, data = load(client.get("/api/aliases/votestakes")) |
||
35 | |||
36 | expect(status) == 200 |
||
37 | expect(len(data)) == 5 |
||
38 |