def test_unknown_definition(): """Check we process not found error.""" definitions = anaconda_mode.goto_definitions(''' raise ''', 2, 5, None) assert not definitions
def test_goto_definitions(): """Check goto definitions works.""" path = abspath('test.py') definitions = anaconda_mode.goto_definitions(''' def fn(a, b): pass fn(1, 2) ''', 4, 2, path) assert 2 == definitions[0]['line'] assert 4 == definitions[0]['column'] assert path == definitions[0]['module-path']
def test_goto_definitions(): """Check goto definitions works.""" path = abspath("test.py") definitions = anaconda_mode.goto_definitions( """ def fn(a, b): pass fn(1, 2) """, 4, 2, path, ) assert 2 == definitions[0]["line"] assert 4 == definitions[0]["column"] assert path == definitions[0]["module-path"]
def test_goto_definitions(): """Check goto definitions works.""" path = abspath('test.py') definitions = anaconda_mode.goto_definitions(''' def fn(a, b): pass fn(1, 2) ''', 4, 2, path) assert definitions == [{ 'line': 2, 'column': 0, 'name': 'fn', 'description': 'def fn(a, b):', 'module': 'test', 'type': 'function', 'path': path }]
def test_goto_definitions(): """Check goto definitions works.""" path = abspath('test.py') definitions = anaconda_mode.goto_definitions( ''' def fn(a, b): pass fn(1, 2) ''', 4, 2, path) assert definitions == [{ 'line': 2, 'column': 0, 'name': 'fn', 'description': 'def fn(a, b):', 'module': 'test', 'type': 'function', 'path': path }]