Ejemplo n.º 1
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")
Ejemplo n.º 2
0
    def test_user_dvd(self):
        john = User("John")
        command = "pause"
        john.dvd_switch(command)

        self.assertEquals(john.dvd_switch(command), DVD.pause(DVD))