예제 #1
0
    def testParser(self):
        print """Testing the loading of new phrases via the config parser"""
        fn_values = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
        agent = 'Alice'
        k = 'chars'

        p = PhraseBankParser()
        
        p.add_section(agent)
        for v in fn_values:
            p.set(agent, k, v)

        phrase_book = p.get_phrasebank(agent)

        out = map(lambda n:phrase_book.render(defName=k), range(0,100))
        out = "".join(out)
        
        
        print "out is", out
        for c in fn_values:
            if c not in out:
                print "%s not in out" % (c)
            self.assertTrue(c in out)