mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 08:09:10 +02:00
Error: typ/title no omitempty
This commit is contained in:
+2
-2
@@ -18,8 +18,8 @@ class Error(jose.JSONObjectWithFields, Exception):
|
||||
'badCSR': 'The CSR is unacceptable (e.g., due to a short key)',
|
||||
}
|
||||
|
||||
typ = jose.Field('type', omitempty=True)
|
||||
title = jose.Field('title', omitempty=True)
|
||||
typ = jose.Field('type')
|
||||
title = jose.Field('title')
|
||||
detail = jose.Field('detail')
|
||||
|
||||
@typ.encoder
|
||||
|
||||
@@ -21,7 +21,7 @@ class ErrorTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
from acme.messages2 import Error
|
||||
self.error = Error(detail='foo', typ='malformed')
|
||||
self.error = Error(detail='foo', typ='malformed', title='title')
|
||||
|
||||
def test_typ_prefix(self):
|
||||
self.assertEqual('malformed', self.error.typ)
|
||||
|
||||
@@ -114,7 +114,8 @@ class NetworkTest(unittest.TestCase):
|
||||
|
||||
def test_check_response_not_ok_jobj_error(self):
|
||||
self.response.ok = False
|
||||
self.response.json.return_value = messages2.Error(detail='foo')
|
||||
self.response.json.return_value = messages2.Error(
|
||||
detail='foo', typ='serverInternal', title='some title').to_json()
|
||||
# pylint: disable=protected-access
|
||||
self.assertRaises(
|
||||
messages2.Error, self.net._check_response, self.response)
|
||||
|
||||
Reference in New Issue
Block a user