示例#1
0
def test_logline_lazy_evaluation():
    """ Check that all LogLine variables are evaluated lazily. """
    
    fields = ['_thread', '_operation', '_namespace', '_duration', '_numYields', '_r', '_ntoreturn', '_nreturned', '_pattern']

    # before parsing all member variables need to be None
    ll = LogLine(line_getmore)
    for attr in fields:
        assert(getattr(ll, attr) == None)

    # after parsing, they all need to be filled out
    ll.parse_all()
    for attr in fields:
        assert(getattr(ll, attr) != None)
示例#2
0
def test_logline_lazy_evaluation():
    """ Check that all LogLine variables are evaluated lazily. """

    fields = [
        '_thread', '_operation', '_namespace', '_duration', '_numYields', '_r',
        '_ntoreturn', '_nreturned'
    ]

    # before parsing all member variables need to be None
    ll = LogLine(line_getmore)
    for attr in fields:
        assert (getattr(ll, attr) == None)

    # after parsing, they all need to be filled out
    ll.parse_all()
    for attr in fields:
        assert (getattr(ll, attr) != None)