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