示例#1
0
 def test_mismatch_sets_matchee(self):
     matcher = EndsWith("bar")
     mismatch = matcher.match("foo")
     self.assertEqual("foo", mismatch.matchee)
示例#2
0
 def test_mismatch_sets_expected(self):
     matcher = EndsWith("bar")
     mismatch = matcher.match("foo")
     self.assertEqual("bar", mismatch.expected)
示例#3
0
 def test_match(self):
     matcher = EndsWith("arf")
     self.assertIs(None, matcher.match("barf"))
示例#4
0
 def test_mismatch_returns_does_not_end_with(self):
     matcher = EndsWith("bar")
     self.assertIsInstance(matcher.match("foo"), DoesNotEndWith)
示例#5
0
 def test_str_with_bytes(self):
     b = _b("\xA7")
     matcher = EndsWith(b)
     self.assertEqual("EndsWith({!r})".format(b), str(matcher))
示例#6
0
 def test_str_with_unicode(self):
     u = "\xA7"
     matcher = EndsWith(u)
     self.assertEqual("EndsWith({!r})".format(u), str(matcher))
示例#7
0
 def test_mismatch_sets_expected(self):
     matcher = EndsWith("bar")
     mismatch = matcher.match("foo")
     self.assertEqual("bar", mismatch.expected)
示例#8
0
 def test_str(self):
     matcher = EndsWith("bar")
     self.assertEqual("EndsWith('bar')", str(matcher))
示例#9
0
 def test_mismatch_sets_matchee(self):
     matcher = EndsWith("bar")
     mismatch = matcher.match("foo")
     self.assertEqual("foo", mismatch.matchee)
示例#10
0
 def test_mismatch_returns_does_not_end_with(self):
     matcher = EndsWith("bar")
     self.assertIsInstance(matcher.match("foo"), DoesNotEndWith)
示例#11
0
 def test_match(self):
     matcher = EndsWith("arf")
     self.assertIs(None, matcher.match("barf"))
示例#12
0
 def test_str_with_unicode(self):
     u = _u("\xA7")
     matcher = EndsWith(u)
     self.assertEqual("EndsWith(%r)" % (u, ), str(matcher))
示例#13
0
 def test_str_with_bytes(self):
     b = _b("\xA7")
     matcher = EndsWith(b)
     self.assertEqual("EndsWith(%r)" % (b, ), str(matcher))