コード例 #1
0
ファイル: test_terrain.py プロジェクト: DominikGuzei/lettuce
def test_world_should_be_able_to_absorb_lambdas():
    u"world should be able to absorb lambdas"
    assert not hasattr(world, 'named_func')

    world.absorb(lambda: 'absorbed', 'named_func')

    assert hasattr(world, 'named_func')
    assert callable(world.named_func)

    assert_equals(world.named_func(), 'absorbed')

    world.spew('named_func')

    assert not hasattr(world, 'named_func')
コード例 #2
0
def test_world_should_be_able_to_absorb_lambdas():
    u"world should be able to absorb lambdas"
    assert not hasattr(world, 'named_func')

    world.absorb(lambda: 'absorbed', 'named_func')

    assert hasattr(world, 'named_func')
    assert callable(world.named_func)

    assert_equals(world.named_func(), 'absorbed')

    world.spew('named_func')

    assert not hasattr(world, 'named_func')
コード例 #3
0
ファイル: test_terrain.py プロジェクト: rpaloschi/lettuce
def test_world_should_be_able_to_absorb_lambdas():
    "world should be able to absorb lambdas"
    assert not hasattr(world, 'named_func')

    world.absorb(lambda: 'absorbed', 'named_func')

    assert hasattr(world, 'named_func')
    assert isinstance(world.named_func, collections.Callable)

    assert_equals(world.named_func(), 'absorbed')

    world.spew('named_func')

    assert not hasattr(world, 'named_func')
コード例 #4
0
ファイル: test_terrain.py プロジェクト: Acetonen/lettuce-py3
def test_world_should_be_able_to_absorb_lambdas():
    "world should be able to absorb lambdas"
    assert not hasattr(world, 'named_func')

    world.absorb(lambda: 'absorbed', 'named_func')

    assert hasattr(world, 'named_func')
    assert isinstance(world.named_func, collections.Callable)

    assert_equals(world.named_func(), 'absorbed')

    world.spew('named_func')

    assert not hasattr(world, 'named_func')