mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
Error: typ/title no omitempty
This commit is contained in:
parent
41115bfc77
commit
0018bc0500
3 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue