fix unicode issues with python2.7

This commit is contained in:
Dave Halter
2014-02-25 12:54:06 +01:00
parent 3a23c80ae5
commit 2252271bf5
4 changed files with 19 additions and 19 deletions

View File

@@ -46,3 +46,21 @@ def test_multibyte_script():
pass # python 3 has no unicode method
else:
assert len(Script(s, 1, len(code)).completions())
def test_goto_definition_at_zero():
"""At zero usually sometimes raises unicode issues."""
assert Script("a", 1, 1).goto_definitions() == []
s = Script("str", 1, 1).goto_definitions()
assert len(s) == 1
assert list(s)[0].description == 'class str'
assert Script("", 1, 0).goto_definitions() == []
def test_complete_at_zero():
s = Script("str", 1, 3).completions()
assert len(s) == 1
assert list(s)[0].name == 'str'
s = Script("", 1, 0).completions()
assert len(s) > 0

View File

@@ -56,21 +56,6 @@ class TestRegression(TestCase):
self.assertRaises(jedi.NotFoundError, get_def, cls)
def test_goto_definition_at_zero(self):
assert Script("a", 1, 1).goto_definitions() == []
s = Script("str", 1, 1).goto_definitions()
assert len(s) == 1
assert list(s)[0].description == 'class str'
assert Script("", 1, 0).goto_definitions() == []
def test_complete_at_zero(self):
s = Script("str", 1, 3).completions()
assert len(s) == 1
assert list(s)[0].name == 'str'
s = Script("", 1, 0).completions()
assert len(s) > 0
@pytest.mark.skip('Skip for now, test case is not really supported.')
@cwd_at('jedi')
def test_add_dynamic_mods(self):