

def testList(self):
    tplt = 'Value List boo (on.)\nValue hoo (tw.)\n\nStart\n  ^$boo\n  ^$hoo -> Next.Record\n\nEOF'
    t = textfsm.TextFSM(cStringIO.StringIO(tplt))
    data = 'one\ntwo\non0\ntw0'
    result = t.ParseText(data)
    self.failUnlessEqual(str(result), "[[['one'], 'two'], [['on0'], 'tw0']]")
    tplt = 'Value List,Filldown boo (on.)\nValue hoo (on.)\n\nStart\n  ^$boo -> Continue\n  ^$hoo -> Next.Record\n\nEOF'
    t = textfsm.TextFSM(cStringIO.StringIO(tplt))
    data = 'one\non0\non1'
    result = t.ParseText(data)
    self.failUnlessEqual(str(result), "[[['one'], 'one'], [['one', 'on0'], 'on0'], [['one', 'on0', 'on1'], 'on1']]")
    tplt = 'Value List,Required boo (on.)\nValue hoo (tw.)\n\nStart\n  ^$boo -> Continue\n  ^$hoo -> Next.Record\n\nEOF'
    t = textfsm.TextFSM(cStringIO.StringIO(tplt))
    data = 'one\ntwo\ntw2'
    result = t.ParseText(data)
    self.failUnlessEqual(str(result), "[[['one'], 'two']]")

dataset/ETHPy150Open google/textfsm/textfsm_test.py UnitTestFSM.testList/original