Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/p/y/python-ceilometerclient-1.0.10/ceilometerclient/tests/test_exc.py   python-ceilometerclient(Download)
    def test_str_no_details(self):
        exception = exc.HTTPBadRequest()
        self.assertEqual("HTTPBadRequest (HTTP 400)", str(exception))
 
    def test_str_no_json(self):
        exception = exc.HTTPBadRequest(details="foo")
        self.assertEqual("HTTPBadRequest (HTTP 400)", str(exception))
 
    def test_str_no_error_message(self):
        exception = exc.HTTPBadRequest(details=json.dumps({}))
    def test_str_no_faultstring(self):
        exception = exc.HTTPBadRequest(
            details=json.dumps({"error_message": {"foo": "bar"}}))
        self.assertEqual("HTTPBadRequest (HTTP 400)", str(exception))
 
    def test_str_error_message_unknown_format(self):
        exception = exc.HTTPBadRequest(
            details=json.dumps({"error_message": "oops"}))