Пример #1
0
 def testDescribeMismatchDescription(self):
     self.assert_describe_mismatch("was <FakeWithStr>", has_string("foo"), FakeWithStr())
Пример #2
0
 def testSuccessfulMatchDoesNotGenerateMismatchDescription(self):
     self.assert_no_mismatch_description(has_string("FakeWithStr"), FakeWithStr())
Пример #3
0
 def testProvidesConvenientShortcutForHasStringEqualTo(self):
     self.assert_matches("equal", has_string("FakeWithStr"), FakeWithStr())
     self.assert_does_not_match("unequal", has_string("FakeWithStr"), 3)
Пример #4
0
 def testHasReadableDescription(self):
     self.assert_description("an object with str 'foo'", has_string("foo"))
Пример #5
0
 def testPassesResultOfToStrToNestedMatcher(self):
     self.assert_matches("equal", has_string(equal_to("FakeWithStr")), FakeWithStr())
     self.assert_does_not_match("unequal", has_string(equal_to("FakeWithStr")), 3)