Esempio n. 1
0
def test_testLiteralInterface():
    obj = JSObjectLiteralForInterface()
    friendly = obj.give_me_friendly()
    gen = obj.give_me_friendly_generator()

    assert friendly.hello() == "I am literally friendly!"
    assert gen.hello() == "giveMeFriendlyGenerator"
    assert gen.next() == 42
Esempio n. 2
0
def test_testInterfaceParameter():
    obj = JSObjectLiteralForInterface()
    friendly = obj.give_me_friendly()
    greeting_augmenter = GreetingAugmenter()

    assert friendly.hello() == "I am literally friendly!"
    assert (greeting_augmenter.better_greeting(friendly) ==
            "I am literally friendly! Let me buy you a drink!")