예제 #1
0
def test_lazy_execution():
    from bigchaindb.utils import Lazy

    lz = Lazy()
    lz.split(',')[1].split(' ').pop(1).strip()
    result = lz.run('Like humans, cats tend to favor one paw over another')
    assert result == 'cats'

    class Cat:
        def __init__(self, name):
            self.name = name

    cat = Cat('Shmui')

    lz = Lazy()
    lz.name.upper()
    result = lz.run(cat)
    assert result == 'SHMUI'
예제 #2
0
def test_lazy_execution():
    from bigchaindb.utils import Lazy

    lz = Lazy()
    lz.split(',')[1].split(' ').pop(1).strip()
    result = lz.run('Like humans, cats tend to favor one paw over another')
    assert result == 'cats'

    class Cat:
        def __init__(self, name):
            self.name = name

    cat = Cat('Shmui')

    lz = Lazy()
    lz.name.upper()
    result = lz.run(cat)
    assert result == 'SHMUI'
예제 #3
0
 def query(self):
     return Lazy()