예제 #1
0
class LexerTestCase(unittest.TestCase):
    def setUp(self):
        self.lexer = HttpPromptLexer()

    def get_tokens(self, text):
        tokens = []
        for ttype, value in self.lexer.get_tokens(text):
            if value.strip():
                tokens.append((ttype, value))
        return tokens
예제 #2
0
class LexerTestCase(unittest.TestCase):
    def setUp(self):
        self.lexer = HttpPromptLexer()

    def get_tokens(self, text, filter_spaces=True):
        tokens = self.lexer.get_tokens(text)
        tokens = filter(lambda t: t[1], tokens)
        if filter_spaces:
            tokens = filter(lambda t: t[1].strip(), tokens)
        return list(tokens)
예제 #3
0
class LexerTestCase(unittest.TestCase):
    def setUp(self):
        self.lexer = HttpPromptLexer()

    def get_tokens(self, text):
        tokens = []
        for ttype, value in self.lexer.get_tokens(text):
            if value.strip():
                tokens.append((ttype, value))
        return tokens
예제 #4
0
class LexerTestCase(unittest.TestCase):

    def setUp(self):
        self.lexer = HttpPromptLexer()

    def get_tokens(self, text, filter_spaces=True):
        tokens = self.lexer.get_tokens(text)
        tokens = filter(lambda t: t[1], tokens)
        if filter_spaces:
            tokens = filter(lambda t: t[1].strip(), tokens)
        return list(tokens)
예제 #5
0
 def setUp(self):
     self.lexer = HttpPromptLexer()
예제 #6
0
 def setUp(self):
     self.lexer = HttpPromptLexer()