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