()
| 66 | |
| 67 | |
| 68 | def test_flow_set(): |
| 69 | sa = core.Core() |
| 70 | with taddons.context(loadcore=False): |
| 71 | f = tflow.tflow(resp=True) |
| 72 | assert sa.flow_set_options() |
| 73 | |
| 74 | assert f.request.method != "post" |
| 75 | sa.flow_set([f], "method", "post") |
| 76 | assert f.request.method == "POST" |
| 77 | |
| 78 | assert f.request.host != "testhost" |
| 79 | sa.flow_set([f], "host", "testhost") |
| 80 | assert f.request.host == "testhost" |
| 81 | |
| 82 | assert f.request.path != "/test/path" |
| 83 | sa.flow_set([f], "path", "/test/path") |
| 84 | assert f.request.path == "/test/path" |
| 85 | |
| 86 | assert f.request.url != "http://foo.com/bar" |
| 87 | sa.flow_set([f], "url", "http://foo.com/bar") |
| 88 | assert f.request.url == "http://foo.com/bar" |
| 89 | with pytest.raises(exceptions.CommandError): |
| 90 | sa.flow_set([f], "url", "oink") |
| 91 | |
| 92 | assert f.response.status_code != 404 |
| 93 | sa.flow_set([f], "status_code", "404") |
| 94 | assert f.response.status_code == 404 |
| 95 | assert f.response.reason == "Not Found" |
| 96 | with pytest.raises(exceptions.CommandError): |
| 97 | sa.flow_set([f], "status_code", "oink") |
| 98 | |
| 99 | assert f.response.reason != "foo" |
| 100 | sa.flow_set([f], "reason", "foo") |
| 101 | assert f.response.reason == "foo" |
| 102 | |
| 103 | |
| 104 | def test_encoding(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…