예제 #1
0
    def test_matches_by_match_failure_with_message(self):

        matcher = re.compile('ab.*')
        try:
            Assert.matches("Absolutely", matcher, msg="failure message")
        except AssertionError as e:
            Assert.equal(e.msg, "'Absolutely' did not match 'ab.*'. failure message")
예제 #2
0
 def test_matches_by_string_failure_no_message(self):
     try:
         Assert.matches('Absolutely', '^sol')
     except AssertionError as e:
         Assert.equal(e.msg, "'Absolutely' did not match '^sol'. ")
예제 #3
0
 def test_matches_by_string_end(self):
     Assert.matches('absolutely', 'ly$')
예제 #4
0
 def test_matches_by_string_begining(self):
     Assert.matches('absolutely', '^ab')
예제 #5
0
 def test_matches_by_match(self):
     matcher = re.compile('ab.*', re.IGNORECASE)
     Assert.matches("Absolutely", matcher)