mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
add function to format the assertion message
This function is used to prettify the assertion message when a matcher failed and return an assertion error.
This commit is contained in:
@@ -157,3 +157,18 @@ def test_metchers():
|
||||
assert_matcher('port')
|
||||
assert_matcher('path')
|
||||
assert_matcher('query')
|
||||
|
||||
|
||||
def test_get_assertion_message():
|
||||
assert matchers.get_assertion_message(None) == ""
|
||||
assert matchers.get_assertion_message("") == ""
|
||||
|
||||
|
||||
def test_get_assertion_message_with_details():
|
||||
assertion_msg = "q1=1 != q2=1"
|
||||
expected = (
|
||||
"--------------- DETAILS ---------------\n"
|
||||
"{}\n"
|
||||
"----------------------------------------\n".format(assertion_msg)
|
||||
)
|
||||
assert matchers.get_assertion_message(assertion_msg) == expected
|
||||
|
||||
Reference in New Issue
Block a user