Beispiel #1
0
def strict_re_search_test():
    ''' Basic strict re_search test '''
    regexp = r'a\d'
    ok_(re_search(regexp, "a1"))
    ok_(re_search(strict(regexp), "a1"))
    yield failed_re_search, strict(regexp), "ba12"
    yield failed_re_search, strict(regexp), "ba1"
    yield failed_re_search, strict(regexp), "a12"
Beispiel #2
0
def already_strict_error_test():
    ''' Check for expected error when stricting (semi)strict regexp '''
    for pattern in ['^test', 'test$', '^test$', strict('test')]:
        yield _failed_strict, pattern
Beispiel #3
0
def _failed_strict(pattern):
    strict(pattern)