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())
def setUp(self): self.m = Marmot('sony')