Exemplo n.º 1
0
 def test_unicode_attribute(self):
     """ github jedi-vim issue #94 """
     s1 = utf8('#-*- coding: utf-8 -*-\nclass Person():\n'
               '    name = "e"\n\nPerson().name.')
     completions1 = self.completions(s1)
     assert 'strip' in [c.name for c in completions1]
     s2 = utf8('#-*- coding: utf-8 -*-\nclass Person():\n'
               '    name = "é"\n\nPerson().name.')
     completions2 = self.completions(s2)
     assert 'strip' in [c.name for c in completions2]
Exemplo n.º 2
0
 def test_unicode_attribute(self):
     """ github jedi-vim issue #94 """
     s1 = utf8('#-*- coding: utf-8 -*-\nclass Person():\n'
               '    name = "e"\n\nPerson().name.')
     completions1 = self.completions(s1)
     assert 'strip' in [c.name for c in completions1]
     s2 = utf8('#-*- coding: utf-8 -*-\nclass Person():\n'
               '    name = "é"\n\nPerson().name.')
     completions2 = self.completions(s2)
     assert 'strip' in [c.name for c in completions2]
Exemplo n.º 3
0
    def test_unicode_script(self):
        """ normally no unicode objects are being used. (<=2.7) """
        s = unicode("import datetime; datetime.timedelta")
        completions = self.complete(s)
        assert len(completions)
        assert type(completions[0].description) is unicode

        s = utf8("author='öä'; author")
        completions = self.complete(s)
        assert type(completions[0].description) is unicode

        s = utf8("#-*- coding: iso-8859-1 -*-\nauthor='öä'; author")
        s = s.encode('latin-1')
        completions = self.complete(s)
        assert type(completions[0].description) is unicode
Exemplo n.º 4
0
    def test_unicode_script(self):
        """ normally no unicode objects are being used. (<=2.7) """
        s = unicode("import datetime; datetime.timedelta")
        completions = self.complete(s)
        assert len(completions)
        assert type(completions[0].description) is unicode

        s = utf8("author='öä'; author")
        completions = self.complete(s)
        assert type(completions[0].description) is unicode

        s = utf8("#-*- coding: iso-8859-1 -*-\nauthor='öä'; author")
        s = s.encode('latin-1')
        completions = self.complete(s)
        assert type(completions[0].description) is unicode
Exemplo n.º 5
0
 def test_multibyte_script(self):
     """ `jedi.Script` must accept multi-byte string source. """
     try:
         code = unicode("import datetime; datetime.d")
         comment = utf8("# multi-byte comment あいうえおä")
         s = (unicode('%s\n%s') % (code, comment)).encode('utf-8')
     except NameError:
         pass  # python 3 has no unicode method
     else:
         assert len(self.completions(s, (1, len(code))))
Exemplo n.º 6
0
 def test_multibyte_script(self):
     """ `jedi.Script` must accept multi-byte string source. """
     try:
         code = unicode("import datetime; datetime.d")
         comment = utf8("# multi-byte comment あいうえおä")
         s = (unicode('%s\n%s') % (code, comment)).encode('utf-8')
     except NameError:
         pass  # python 3 has no unicode method
     else:
         assert len(self.completions(s, (1, len(code))))