Fix some remaining issues with file path completions

This commit is contained in:
Dave Halter
2019-08-07 23:00:27 +02:00
parent a191b7b458
commit 52517f78b1
2 changed files with 34 additions and 16 deletions

View File

@@ -225,12 +225,23 @@ os_path = 'from os.path import *\n'
(f2, os_path + 'join(r"tes"', 10, ['t"']),
(f2, os_path + 'join("""tes""")', 11, ['t"""']),
# Almost like join but not really
(f2, os_path + 'join["tes', 9, ['t' + s]),
(f2, os_path + 'join["tes"', 9, ['t' + s]),
(f2, os_path + 'join["tes"]', 9, ['t' + s]),
(f2, os_path + 'join[dirname(__file__), "completi', 33, []),
(f2, os_path + 'join[dirname(__file__), "completi"', 33, []),
(f2, os_path + 'join[dirname(__file__), "completi"]', 33, []),
# With full paths
(f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi', 49, ['on"']),
(f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi"', 49, ['on"']),
(f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi")', 49, ['on"']),
# With alias
(f2, 'import os.path as p as p\np.join(p.dirname(__file__), "completi', None, ['on"']),
(f2, 'from os.path import dirname, join as j\nj(dirname(__file__), "completi',
None, ['on"']),
]
)
def test_file_path_completions(Script, file, code, column, expected):