Add quotes around expected/actual string in assertion message

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2019-08-21 20:57:44 +02:00
parent 7fe4d2ff39
commit 6d09d8fe13

View file

@ -63,14 +63,14 @@ class TestCase(BaseTestCase):
"tags", "tags",
expectedTags, expectedTags,
description, description,
"{} of {} do not match (expected: {}, actual: {})") "{} of {} do not match (expected: '{}', actual: '{}')")
if expectedAnnotation: if expectedAnnotation:
self.assertKeyExists(interval, "annotation", description, "{} is not annotated") self.assertKeyExists(interval, "annotation", description, "{} is not annotated")
self.assertIntervalValue(interval, self.assertIntervalValue(interval,
"annotation", "annotation",
expectedAnnotation, expectedAnnotation,
description, description,
"{} of {} do not match (expected: {}, actual: {})") "{} of {} do not match (expected: '{}', actual: '{}')")
def assertKeyExists(self, interval, key, description, message): def assertKeyExists(self, interval, key, description, message):
self.assertTrue(key in interval, message.format(description)) self.assertTrue(key in interval, message.format(description))
@ -86,7 +86,7 @@ class TestCase(BaseTestCase):
key, key,
expected, expected,
description, description,
"{} time of {} does not match (expected: {}, actual: {})") "{} time of {} does not match (expected: '{}', actual: '{}')")
def assertIntervalValue(self, interval, key, expected, description, message): def assertIntervalValue(self, interval, key, expected, description, message):
actual = interval[key] actual = interval[key]