Ejemplo n.º 1
0
def test_laziness():
    """
    lib/lazyregex.py: Test laziness

    Test to make sure LazyRegex doesn't create the compiled regular
    expression object until it is needed.
    """
    l = LazyRegex("beep")
    assert l._regex is None
    assert l.get_regex()
    assert l._regex is not None
Ejemplo n.º 2
0
def test_laziness():
    """
    lib/lazyregex.py: Test laziness

    Test to make sure LazyRegex doesn't create the compiled regular
    expression object until it is needed.
    """
    l = LazyRegex("beep")
    assert l._regex is None
    assert l.get_regex()
    assert l._regex is not None
Ejemplo n.º 3
0
def test_get_regex():
    """
    lib/lazyregex.py: Tests LazyRegex.get_regex() method
    """
    l = LazyRegex("beep")
    assert type(l.get_regex()) == type(re.compile("beep"))
Ejemplo n.º 4
0
def test_get_regex():
    """
    lib/lazyregex.py: Tests LazyRegex.get_regex() method
    """
    l = LazyRegex("beep")
    assert type(l.get_regex()) == type(re.compile("beep"))