def test_reload_unexpected_url(self): """ If the error URL is not the root, the error is propagated. """ error = HTTPError(self.api.url, 503, "Service Unavailable", {}, None) error.url = "/foo" self.fakes.jenkins.responses[urljoin(self.api.url, "reload")] = error self.assertRaises(HTTPError, self.api.reload)
def test_reload_unexpected_url(self): """ If the error URL is not the root, the error is propagated. """ error = HTTPError(URL, 503, "Service Unavailable", {}, None) error.url = "/foo" self.fakes.jenkins.responses[urljoin(URL, "/reload")] = error self.assertRaises(HTTPError, self.api.reload)
def test_reload(self): """ The reload method POSTs a request to the '/reload' URL, expecting a 503 on the homepage (which happens after redirection). """ error = HTTPError(self.api.url, 503, "Service Unavailable", {}, None) error.url = self.api.url self.fakes.jenkins.responses[urljoin(self.api.url, "reload")] = error self.api.reload()
def test_reload(self): """ The reload method POSTs a request to the '/reload' URL, expecting a 503 on the homepage (which happens after redirection). """ error = HTTPError(URL, 503, "Service Unavailable", {}, None) error.url = URL self.fakes.jenkins.responses[urljoin(URL, "/reload")] = error self.api.reload()