Beispiel #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")
Beispiel #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'. ")
Beispiel #3
0
 def test_matches_by_string_end(self):
     Assert.matches('absolutely', 'ly$')
Beispiel #4
0
 def test_matches_by_string_begining(self):
     Assert.matches('absolutely', '^ab')
Beispiel #5
0
 def test_matches_by_match(self):
     matcher = re.compile('ab.*', re.IGNORECASE)
     Assert.matches("Absolutely", matcher)