()
| 230 | |
| 231 | |
| 232 | def test_create(): |
| 233 | v = view.View() |
| 234 | with taddons.context(): |
| 235 | v.create("get", "http://foo.com") |
| 236 | assert len(v) == 1 |
| 237 | assert v[0].request.url == "http://foo.com/" |
| 238 | v.create("get", "http://foo.com") |
| 239 | assert len(v) == 2 |
| 240 | with pytest.raises(exceptions.CommandError, match="Invalid URL"): |
| 241 | v.create("get", "http://foo.com\\") |
| 242 | with pytest.raises(exceptions.CommandError, match="Invalid URL"): |
| 243 | v.create("get", "http://") |
| 244 | |
| 245 | |
| 246 | def test_orders(): |