def testPython(self):
        lexer = CompletionLexer(PythonLexer())

        # Test simplest case.
        self.assertEquals(lexer.get_context("foo.bar.baz"),
                          [ "foo", "bar", "baz" ])

        # Test trailing period.
        self.assertEquals(lexer.get_context("foo.bar."), [ "foo", "bar", "" ])

        # Test with prompt present.
        self.assertEquals(lexer.get_context(">>> foo.bar.baz"),
                          [ "foo", "bar", "baz" ])

        # Test spacing in name.
        self.assertEquals(lexer.get_context("foo.bar. baz"), [ "baz" ])

        # Test parenthesis.
        self.assertEquals(lexer.get_context("foo("), [])
Does the CompletionLexer work for Python?
dataset/ETHPy150Open ipython/ipython-py3k/IPython/frontend/qt/console/tests/test_completion_lexer.py/TestCompletionLexer.testPython