Exemplo n.º 1
0
    def test_default_sequence(self):
        square = Square()

        square.construct_platform()
        square.bring_crowd()
        square.invite_speaker()

        square.speaker_talk()
        square.make_noise()
        self.assertNotEqual(square.arthur.state, "flying")
        square.make_noise()

        # at this point Arthur should be flying
        self.assertEqual(square.arthur.state, "flying")
Exemplo n.º 2
0
    def test_crowd_invites_speaker(self):
        ''' Just another way to make Arthur fly

        Crowd comes makes some noise, platform is getting build, they invite
        speaker and one more noise -- Arthur is flying
        '''
        square = Square()
        square.bring_crowd()
        square.make_noise()
        square.construct_platform()
        square.invite_speaker()
        square.speaker_talk()
        self.assertNotEqual(square.arthur.state, "flying")
        square.make_noise()
        self.assertEqual(square.arthur.state, "flying")
Exemplo n.º 3
0
 def test_inviting_speaker_again(self):
     square = Square()
     square.construct_platform()
     square.invite_speaker()
     self.assertRaises(ValueError, square.invite_speaker)
Exemplo n.º 4
0
 def test_inviting_speaker_on_platform(self):
     square = Square()
     square.construct_platform()
     self.assertIsNotNone(square.invite_speaker())
Exemplo n.º 5
0
 def test_constructing_platform_again(self):
     square = Square()
     platform = square.construct_platform()
     self.assertRaises(RuntimeError, square.construct_platform)
Exemplo n.º 6
0
 def test_constructing_platform(self):
     square = Square()
     platform = square.construct_platform()
     self.assertIsNotNone(platform)