예제 #1
0
 def test_if_message_given_message(self):
     # Annotate.if_message returns an annotated version of the matcher if a
     # message is provided.
     matcher = Equals(1)
     expected = Annotate("foo", matcher)
     annotated = Annotate.if_message("foo", matcher)
     self.assertThat(annotated, MatchesStructure.fromExample(expected, "annotation", "matcher"))
예제 #2
0
 def test_if_message_given_message(self):
     # Annotate.if_message returns an annotated version of the matcher if a
     # message is provided.
     matcher = Equals(1)
     expected = Annotate('foo', matcher)
     annotated = Annotate.if_message('foo', matcher)
     self.assertThat(
         annotated,
         MatchesStructure.fromExample(expected, 'annotation', 'matcher'))
예제 #3
0
 def test_if_message_no_message(self):
     # Annotate.if_message returns the given matcher if there is no
     # message.
     matcher = Equals(1)
     not_annotated = Annotate.if_message('', matcher)
     self.assertIs(matcher, not_annotated)
예제 #4
0
 def test_if_message_no_message(self):
     # Annotate.if_message returns the given matcher if there is no
     # message.
     matcher = Equals(1)
     not_annotated = Annotate.if_message("", matcher)
     self.assertIs(matcher, not_annotated)