Beispiel #1
0
 def test_init(self):
     lion1 = cLion('Hungry')
     self.assertEqual('Hungry', lion1.state,
                      'Init Error State must be Hungry')
     lion2 = cLion('Fed')
     self.assertEqual('Fed', lion2.state, 'Init Error State must be Fed')
Beispiel #2
0
 def test_tree_negative_state(self):
     lion = cLion('Tired')
     self.assertEqual('ERR: Undefined Input and CurrentState combination',
                      lion.execTransition('Tree'),
                      'Tree+Tired WRONG Output')
Beispiel #3
0
 def test_tree_negative_input(self):
     lion = cLion('Fed')
     self.assertEqual('ERR: Undefined Input and CurrentState combination',
                      lion.execTransition('Zebra'),
                      'Zebra+Fed WRONG Output')
Beispiel #4
0
 def test_tree_hng(self):
     lion = cLion('Hungry')
     self.assertEqual('Sleep', lion.execTransition('Tree'),
                      'Tree+Hungry WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Tree+Hungry WRONG State')
Beispiel #5
0
 def test_tree_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Look', lion.execTransition('Tree'),
                      'Tree+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Tree+Fed WRONG State')
Beispiel #6
0
 def test_ante_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Sleep', lion.execTransition('Antelope'),
                      'Antelope+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Antelope+Fed WRONG State')
Beispiel #7
0
 def test_hunt_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Escape', lion.execTransition('Hunter'),
                      'Hunter+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Hunter+Fed WRONG State')
 def test_init(self):
     lion1 = cLion('Hungry')
     self.assertEqual('Hungry', lion1.state, 'Init Error State must be Hungry')
     lion2 = cLion('Fed')
     self.assertEqual('Fed', lion2.state, 'Init Error State must be Fed')
Beispiel #9
0
 def test_ante_hng(self):
     lion = cLion('Hungry')
     self.assertEqual('Eat', lion.execTransition('Antelope'),
                      'Antelope+Hungry WRONG Output')
     self.assertEqual('Fed', lion.state, 'Antelope+Hungry WRONG State')
 def test_tree_negative_state(self):
     lion = cLion('Tired')
     self.assertEqual('ERR: Undefined Input and CurrentState combination', lion.execTransition('Tree'), 'Tree+Tired WRONG Output')
 def test_tree_negative_input(self):
     lion = cLion('Fed')
     self.assertEqual('ERR: Undefined Input and CurrentState combination', lion.execTransition('Zebra'), 'Zebra+Fed WRONG Output')
 def test_tree_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Look', lion.execTransition('Tree'), 'Tree+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Tree+Fed WRONG State')
 def test_tree_hng(self):
     lion = cLion('Hungry')
     self.assertEqual('Sleep', lion.execTransition('Tree'), 'Tree+Hungry WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Tree+Hungry WRONG State')
 def test_hunt_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Escape', lion.execTransition('Hunter'), 'Hunter+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Hunter+Fed WRONG State')
 def test_ante_fed(self):
     lion = cLion('Fed')
     self.assertEqual('Sleep', lion.execTransition('Antelope'), 'Antelope+Fed WRONG Output')
     self.assertEqual('Hungry', lion.state, 'Antelope+Fed WRONG State')
 def test_ante_hng(self):
     lion = cLion('Hungry')
     self.assertEqual('Eat', lion.execTransition('Antelope'), 'Antelope+Hungry WRONG Output')
     self.assertEqual('Fed', lion.state, 'Antelope+Hungry WRONG State')