Lines Matching refs:lookup
99 self.assertTrue(self.spam.lookup("glob").is_global())
100 self.assertFalse(self.spam.lookup("glob").is_declared_global())
101 self.assertTrue(self.spam.lookup("bar").is_global())
102 self.assertTrue(self.spam.lookup("bar").is_declared_global())
103 self.assertFalse(self.internal.lookup("x").is_global())
104 self.assertFalse(self.Mine.lookup("instance_var").is_global())
105 self.assertTrue(self.spam.lookup("bar").is_global())
107 self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_global())
108 self.assertTrue(self.top.lookup("some_assigned_global_var").is_global())
111 self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
112 self.assertTrue(self.other_internal.lookup("some_var").is_nonlocal())
117 self.assertTrue(self.spam.lookup("x").is_local())
118 self.assertFalse(self.spam.lookup("bar").is_local())
120 self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_local())
121 self.assertTrue(self.top.lookup("some_assigned_global_var").is_local())
124 self.assertTrue(self.internal.lookup("x").is_free())
127 self.assertTrue(self.internal.lookup("x").is_referenced())
128 self.assertTrue(self.spam.lookup("internal").is_referenced())
129 self.assertFalse(self.spam.lookup("x").is_referenced())
133 self.assertTrue(self.spam.lookup(sym).is_parameter())
134 self.assertFalse(self.spam.lookup("x").is_parameter())
140 self.assertRaises(KeyError, self.top.lookup, "not_here")
143 self.assertTrue(self.top.lookup("Mine").is_namespace())
144 self.assertTrue(self.Mine.lookup("a_method").is_namespace())
145 self.assertTrue(self.top.lookup("spam").is_namespace())
146 self.assertTrue(self.spam.lookup("internal").is_namespace())
147 self.assertTrue(self.top.lookup("namespace_test").is_namespace())
148 self.assertFalse(self.spam.lookup("x").is_namespace())
150 self.assertTrue(self.top.lookup("spam").get_namespace() is self.spam)
151 ns_test = self.top.lookup("namespace_test")
156 self.assertTrue(self.spam.lookup("x").is_assigned())
157 self.assertTrue(self.spam.lookup("bar").is_assigned())
158 self.assertTrue(self.top.lookup("spam").is_assigned())
159 self.assertTrue(self.Mine.lookup("a_method").is_assigned())
160 self.assertFalse(self.internal.lookup("x").is_assigned())
165 self.assertTrue(st2.lookup('x').is_local())
166 self.assertTrue(st2.lookup('x').is_annotated())
167 self.assertFalse(st2.lookup('x').is_global())
170 self.assertTrue(st4.lookup('x').is_local())
171 self.assertFalse(st4.lookup('x').is_annotated())
176 self.assertTrue(st5.lookup("x").is_global())
188 self.assertTrue(self.top.lookup("sys").is_imported())
193 self.assertEqual(self.spam.lookup("x").get_name(), "x")