|
@@ 168-187 (lines=20) @@
|
| 165 |
|
expect(data).contains('width=67') |
| 166 |
|
expect(data).contains('height=89') |
| 167 |
|
|
| 168 |
|
def describe_watermark(): |
| 169 |
|
|
| 170 |
|
def it_accept_supported_watermark(client): |
| 171 |
|
response = client.get("/iw/test.jpg?watermark=test") |
| 172 |
|
|
| 173 |
|
expect(response.status_code) == 200 |
| 174 |
|
expect(response.mimetype) == 'image/jpeg' |
| 175 |
|
|
| 176 |
|
def it_redirects_with_unsupported_watermark(client): |
| 177 |
|
status, data = load(client.get( |
| 178 |
|
"/iw/test.jpg?watermark=unsupported")) |
| 179 |
|
|
| 180 |
|
expect(status) == 302 |
| 181 |
|
expect(data).contains('<a href="/iw/test.jpg"') |
| 182 |
|
|
| 183 |
|
def it_keeps_watermark_after_redirect(client): |
| 184 |
|
status, data = load(client.get("/iw/test 2.jpg?watermark=test")) |
| 185 |
|
|
| 186 |
|
expect(status) == 302 |
| 187 |
|
expect(data).contains('<a href="/iw/test_2.jpg?watermark=test"') |
| 188 |
|
|
| 189 |
|
def describe_preview(): |
| 190 |
|
|
|
@@ 137-155 (lines=19) @@
|
| 134 |
|
expect(status) == 302 |
| 135 |
|
expect(data).contains('<a href="/sad-biden/hello.jpg">') |
| 136 |
|
|
| 137 |
|
def describe_custom_font(): |
| 138 |
|
|
| 139 |
|
def when_provided(client): |
| 140 |
|
response = client.get("/iw/hello.jpg?font=impact") |
| 141 |
|
|
| 142 |
|
expect(response.status_code) == 200 |
| 143 |
|
expect(response.mimetype) == 'image/jpeg' |
| 144 |
|
|
| 145 |
|
def it_redirects_on_unknown_fonts(client): |
| 146 |
|
status, data = load(client.get("/iw/hello.jpg?font=__unknown__")) |
| 147 |
|
|
| 148 |
|
expect(status) == 302 |
| 149 |
|
expect(data).contains('<a href="/iw/hello.jpg">') |
| 150 |
|
|
| 151 |
|
def it_keeps_font_after_redirect(client): |
| 152 |
|
status, data = load(client.get("/iw/what%3F.jpg?font=impact")) |
| 153 |
|
|
| 154 |
|
expect(status) == 302 |
| 155 |
|
expect(data).contains('<a href="/iw/what~q.jpg?font=impact">') |
| 156 |
|
|
| 157 |
|
def describe_custom_size(): |
| 158 |
|
|