def test_get_top(self): """Should return a reference to top node on stack if there is one""" test = SearchPath(SearchPathHelper.alphabets) test._add_node(SearchNode(SearchNodeHelper.alphabet)) topnode = SearchNode(SearchNodeHelper.alphabet) test._add_node(topnode) resultnode = test._get_top() self.assertEquals(resultnode, topnode)
def test_get_top_None(self): """Should return None if stack is empty""" test = SearchPath(SearchPathHelper.alphabets) topnode = test._get_top() self.assertEquals(topnode, None)