class MSDOSSessionTest(unittest.TestCase): def setUp(self): self.lexer = MSDOSSessionLexer() def testGtOnlyPrompt(self): fragment = u'> py\nhi\n' tokens = [ (Token.Text, u''), (Token.Generic.Prompt, u'>'), (Token.Text, u' '), (Token.Text, u'py'), (Token.Text, u''), (Token.Text, u'\n'), (Token.Generic.Output, u'hi\n'), ] self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
def lexer_msdos(): yield MSDOSSessionLexer()
def setUp(self): self.lexer = MSDOSSessionLexer()