Exemplo n.º 1
0
class TestMarmot(unittest.TestCase):
    def setUp(self):
        self.m = Marmot('sony')
  
    def test_name(self):
        self.assertTrue(self.m.name, 'sony')

    def test_marmot_behaviour(self):
        # Feed the Marmot.
        self.m.feed('beer')
        self.m.feed('beer')
        self.m.feed('nut')

        # Whistle test.
        self.assertTrue(self.m.whistle())
        self.assertTrue(self.m.whistle())
        self.assertTrue(self.m.whistle())
        self.assertFalse(self.m.whistle())
Exemplo n.º 2
0
 def setUp(self):
     self.m = Marmot('sony')