def test_match_non_string(self): matcher = EqualsIgnoringWhitespace(1234) self.assertIs(None, matcher.match(1234))
def test_mismatch_unicode(self): matcher = EqualsIgnoringWhitespace(u"one \t two \n \u1234 ") mismatch = matcher.match(u" one \r \u1234 ") self.assertEqual( u"u'one \\u1234' != u'one two \\u1234'", mismatch.describe())
def test_match_unicode(self): matcher = EqualsIgnoringWhitespace(u"one \t two \n \u1234 ") self.assertIs(None, matcher.match(u" one \r two \u1234 "))
def test_mismatch_str(self): matcher = EqualsIgnoringWhitespace("one \t two \n three") mismatch = matcher.match(" one \r three ") self.assertEqual( "'one three' != 'one two three'", mismatch.describe())
def test_match_str(self): matcher = EqualsIgnoringWhitespace("one \t two \n three") self.assertIs(None, matcher.match(" one \r two three "))
def test_str(self): matcher = EqualsIgnoringWhitespace("abc") self.assertEqual("EqualsIgnoringWhitespace('abc')", str(matcher))