Home | History | Annotate | Download | only in markdown

Lines Matching refs:state

59     """ Tests of the State class for BlockParser. """
62 self.state = markdown.blockparser.State()
65 """ Test State when empty. """
66 self.assertEqual(self.state, [])
69 """ Test State.set(). """
70 self.state.set('a_state')
71 self.assertEqual(self.state, ['a_state'])
72 self.state.set('state2')
73 self.assertEqual(self.state, ['a_state', 'state2'])
76 """ Test State.isstate(). """
77 self.assertEqual(self.state.isstate('anything'), False)
78 self.state.set('a_state')
79 self.assertEqual(self.state.isstate('a_state'), True)
80 self.state.set('state2')
81 self.assertEqual(self.state.isstate('state2'), True)
82 self.assertEqual(self.state.isstate('a_state'), False)
83 self.assertEqual(self.state.isstate('missing'), False)
86 """ Test State.reset(). """
87 self.state.set('a_state')
88 self.state.reset()
89 self.assertEqual(self.state, [])
90 self.state.set('state1')
91 self.state.set('state2')
92 self.state.reset()
93 self.assertEqual(self.state, ['state1'])