Beispiel #1
0
    def test_user_tv(self):
        john = User("John")
        command = "tv_mood"
        john.tv_switch(command)

        self.assertEquals(john.name, "John")
        self.assertEquals(john.tv_switch(command), TV.tv_display(TV))
Beispiel #2
0
    def run(self):
        print("Tv is on")
        alice = User("Alice")
        alice.tv_switch("volume up")
        alice.tv_switch("next")
        alice.tv_switch("next")

        print("\n")
        print("{} wants to watch DVD now".format(alice.name))
        alice.tv_switch("dvd_mood")
        alice.dvd_switch("load")
        alice.dvd_switch("play")

        print("\n")
        print("It's time for {} to go to bed".format(alice.name))
        alice.dvd_switch("pause")
        alice.dvd_switch("off")
        alice.tv_switch("tv_mood")
        alice.tv_switch("off")