

def testStateChange(self):
    tplt = 'Value boo (one)\nValue hoo (two)\n\nStart\n  ^$boo -> State1\n\nState1\n  ^$hoo -> Start\n\nEOF'
    t = textfsm.TextFSM(cStringIO.StringIO(tplt))
    data = 'one'
    t.ParseText(data)
    self.failUnlessEqual(t._cur_state[0].match, '^$hoo')
    self.failUnlessEqual('one', t._GetValue('boo').value)
    self.failUnlessEqual(None, t._GetValue('hoo').value)
    t.failUnlessEqual(t._result, [])
    tplt = 'Value boo (one)\nValue hoo (two)\n\nStart\n  ^$boo -> Next.Record State1\n\nState1\n  ^$hoo -> Start\n\nEOF'
    t = textfsm.TextFSM(cStringIO.StringIO(tplt))
    data = 'one'
    t.ParseText(data)
    self.failUnlessEqual(t._cur_state[0].match, '^$hoo')
    self.failUnlessEqual(None, t._GetValue('boo').value)
    self.failUnlessEqual(None, t._GetValue('hoo').value)
    self.failUnlessEqual(t._result, [['one', '']])

dataset/ETHPy150Open google/textfsm/textfsm_test.py UnitTestFSM.testStateChange/VarMisuse@87/181 `self`->`t`