Ejemplo n.º 1
0
def test_world_should_be_able_to_absorb_functions():
    u"world should be able to absorb functions"
    assert not hasattr(world, 'function1')

    @world.absorb
    def function1():
        return 'absorbed'

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

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

    world.spew('function1')

    assert not hasattr(world, 'function1')
Ejemplo n.º 2
0
def test_world_should_be_able_to_absorb_functions():
    u"world should be able to absorb functions"
    assert not hasattr(world, 'function1')

    @world.absorb
    def function1():
        return 'absorbed'

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

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

    world.spew('function1')

    assert not hasattr(world, 'function1')