Ejemplo n.º 1
0
 def test_removeOption_noneLeft(self):
     """removeOption should cull options and return F when none left."""
     
     test = SearchNode(SearchNodeHelper.alphabet)
     num_options = len(test.Options)
     
     #removeOption num_options times: that should get 'em all
     for i in xrange(num_options): some_left = test.removeOption()
     
     #return value should be false (no options remain)
     self.assertEqual(some_left, False)        
Ejemplo n.º 2
0
 def test_removeOption_someLeft(self):
     """removeOption should cull options and return T when some left."""
     
     #create a search node and get its current value
     test = SearchNode(SearchNodeHelper.alphabet)
     last_val = test.Value
     
     some_left = test.removeOption()
     
     #new current value must be different from old
     #and return value must be true
     self.assertNotEqual(test.Value, last_val)
     self.assertEqual(some_left, True)