def test_http_context_clear(self): ctxt_singleton = HttpRequestContext() ctxt_singleton.method = "POST" self.assertEqual("POST", ctxt_singleton.method) ctxt_singleton.clear() self.assertNotEqual("POST", ctxt_singleton.method) ctxt_singleton2 = HttpRequestContext() self.assertNotEqual("POST", ctxt_singleton2.method)
def test_http_context_clear_by_arg(self): ctxt_singleton = HttpRequestContext() ctxt_singleton.fields_to_clear = [] ctxt_singleton.proxy = "http://localhost:8080" ctxt_singleton.method = "PUT" self.assertEqual("http://localhost:8080", ctxt_singleton.proxy) ctxt_singleton.clear("proxy") self.assertNotEqual("http://localhost:8080", ctxt_singleton.proxy) self.assertEqual("PUT", ctxt_singleton.method)