def test_goto_definition_not_multiple():
 s = dedent('            import random\n            class A():\n                def __init__(self, a):\n                    self.a = 3\n\n                def foo(self):\n                    pass\n\n            if random.randint(0, 1):\n                a = A(2)\n            else:\n                a = A(1)\n            a')
 assert (len(api.Script(s).goto_definitions()) == 1)

def test_goto_definition_not_multiple ( ) : s = dedent ( '            import random\n            class A():\n                def __init__(self, a):\n                    self.a = 3\n\n                def foo(self):\n                    pass\n\n            if random.randint(0, 1):\n                a = A(2)\n            else:\n                a = A(1)\n            a' ) assert ( len ( api . Script ( s ) . goto_definitions ( ) ) == 1 )
there should be only one definition result if it leads back to the same origin .