mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-30 21:45:21 +08:00
removed related_names occurences in favor of usages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
Test coverage for renaming is mostly being done by testing
|
||||
`Script.get_related_names`.
|
||||
`Script.usages`.
|
||||
"""
|
||||
|
||||
# --- simple
|
||||
|
||||
@@ -143,7 +143,7 @@ class IntegrationTestCase(object):
|
||||
TEST_COMPLETIONS: self.run_completion,
|
||||
TEST_DEFINITIONS: self.run_definition,
|
||||
TEST_ASSIGNMENTS: self.run_goto,
|
||||
TEST_USAGES: self.run_related_name,
|
||||
TEST_USAGES: self.run_usages,
|
||||
}
|
||||
return testers[self.test_type](compare_cb)
|
||||
|
||||
@@ -192,8 +192,8 @@ class IntegrationTestCase(object):
|
||||
comp_str = str(sorted(str(r.description) for r in result))
|
||||
return compare_cb(self, comp_str, self.correct)
|
||||
|
||||
def run_related_name(self, compare_cb):
|
||||
result = self.script().related_names()
|
||||
def run_usages(self, compare_cb):
|
||||
result = self.script().usages()
|
||||
self.correct = self.correct.strip()
|
||||
compare = sorted((r.module_name, r.start_pos[0], r.start_pos[1])
|
||||
for r in result)
|
||||
|
||||
@@ -38,7 +38,7 @@ def make_definitions():
|
||||
definitions += script.definition()
|
||||
|
||||
script2 = api.Script(source, 4, len('class C'), None)
|
||||
definitions += script2.related_names()
|
||||
definitions += script2.usages()
|
||||
|
||||
source_param = "def f(a): return a"
|
||||
script_param = api.Script(source_param, 1, len(source_param), None)
|
||||
|
||||
Reference in New Issue
Block a user