def test_diff_message_diff_imagemagick(): message = ( "The new screenshot 'C:\\...\\01_login_form__test_login.png' did not match the baseline " "'C:\\...\\login_form.png' (See C:\\...\\01_login_form__test_login.diff.png):\n" "5443.77 (0.0830666) @ 0,0") expected_message = 'Distance of 0.08306660' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_diff_perceptualdiff(): message = "The new screenshot 'C:\\...\\01_login_form__test_login.png' did not match the baseline " message += """'C:\\...\\login_form.png' (See C:\\...\\01_login_form__test_login.diff.png): FAIL: Images are visibly different 15040 pixels are different """ expected_message = 'Distance of 0.01504000' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_diff_imagemagick(): message = ("The new screenshot 'C:\\...\\01_login_form__test_login.png' did not match the baseline " "'C:\\...\\login_form.png' (See C:\\...\\01_login_form__test_login.diff.png):\n" "5443.77 (0.0830666) @ 0,0") expected_message = 'Distance of 0.08306660' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_diff_pil(): message = ("The new screenshot 'C:\\...\\01_login_form__test_login.png' did not match the baseline " "'C:\\...\\login_form.png' (by a distance of 14794.11)") expected_message = 'Distance of 0.01479411' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_size_imagemagick(): message = 'Image dimensions do not match' expected_message = 'Image dimensions do not match' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_size_perceptualdiff(): message = """The new screenshot 'C:\\...\\01_login_form__test_login.png' did not match the baseline 'C:\\...\\login_form.png': FAIL: Image dimensions do not match""" expected_message = 'Image dimensions do not match' assert expected_message == VisualTest._get_diff_message(message, 1000000)
def test_diff_message_equal(): message = None expected_message = '' assert expected_message == VisualTest._get_diff_message(message, 1000000)