1
0
forked from VimPlug/jedi

Start testing the typeshed directory search

This commit is contained in:
Dave Halter
2018-07-25 11:37:03 +02:00
parent b809768934
commit ee43fd7579
2 changed files with 30 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
import os
from jedi.plugins import typeshed
from parso.utils import PythonVersionInfo
def test_get_typeshed_directories():
def get_dirs(version_info):
return {
d.replace(typeshed._TYPESHED_PATH, '').lstrip(os.path.sep)
for d in typeshed._get_typeshed_directories(version_info)
}
dirs = get_dirs(PythonVersionInfo(2, 7))
assert dirs == {'stdlib/2and3', 'stdlib/2', 'third_party/2and3', 'third_party/2'}
dirs = get_dirs(PythonVersionInfo(3, 4))
assert dirs == {'stdlib/2and3', 'stdlib/3', 'third_party/2and3', 'third_party/3'}
dirs = get_dirs(PythonVersionInfo(3, 5))
assert dirs == {'stdlib/2and3', 'stdlib/3', 'stdlib/3.5',
'third_party/2and3', 'third_party/3', 'third_party/3.5'}
dirs = get_dirs(PythonVersionInfo(3, 6))
assert dirs == {'stdlib/2and3', 'stdlib/3', 'stdlib/3.5', 'stdlib/3.6',
'third_party/2and3', 'third_party/3', 'third_party/3.5', 'third_party/3.6'}