示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
 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)