Clean error.message
Unfortunately the way that jsonschema is calling %r on its property
and then encoding the complete message means I've had to do this
manual way of removing the literal string prefix, u'.
eg:
key = 'extends'
message = "Invalid value for %r" % key
error.message = message.encode("utf-8")"
results in:
"Invalid value for u'extends'"
Performing a replace to strip out the extra "u'", does not change the
encoding of the string, it is at this point the character u followed
by a '.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
b4872de213
commit
ece6a72712
2 changed files with 7 additions and 4 deletions
|
|
@ -659,7 +659,7 @@ class ExtendsTest(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_extends_validation_missing_service_key(self):
|
||||
with self.assertRaisesRegexp(ConfigurationError, "u'service' is a required property"):
|
||||
with self.assertRaisesRegexp(ConfigurationError, "'service' is a required property"):
|
||||
config.load(
|
||||
config.ConfigDetails(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue