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