Exemplo n.º 1
0
def test_check_happy():
    test = Animal()
    test.happiness = 50
    test.check_happy()
    assert (test.how_happy == '\033[1;32msuper HAPPY')
    test.happiness = 49
    test.check_happy()
    assert (test.how_happy == '\033[0;36mHAPPY')
    test.happiness = 11
    test.check_happy()
    assert (test.how_happy == '\033[0;36mHAPPY')
    test.happiness = 10
    test.check_happy()
    assert (test.how_happy == '\033[0;31mUNHAPPY')
    test.happiness = 9
    test.check_happy()
    assert (test.how_happy == '\033[0;31mUNHAPPY')
Exemplo n.º 2
0
def test_check_happy():
    test = Animal()
    test.happiness = 50
    test.check_happy()
    assert test.how_happy == "\033[1;32msuper HAPPY"
    test.happiness = 49
    test.check_happy()
    assert test.how_happy == "\033[0;36mHAPPY"
    test.happiness = 11
    test.check_happy()
    assert test.how_happy == "\033[0;36mHAPPY"
    test.happiness = 10
    test.check_happy()
    assert test.how_happy == "\033[0;31mUNHAPPY"
    test.happiness = 9
    test.check_happy()
    assert test.how_happy == "\033[0;31mUNHAPPY"