| 1 |
""" |
| 2 |
Renaming tests. This means search for references. |
| 3 |
I always leave a little bit of space to add room for additions, because the |
| 4 |
results always contain position informations. |
| 5 |
""" |
| 6 |
|
| 7 |
def abcd(): pass |
| 8 |
|
| 9 |
|
| 10 |
abcd.d.a.bsaasd.abcd.d |
| 11 |
|
| 12 |
abcd |
| 13 |
|
| 14 |
x['smörbröd'].abcd |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
if 1: |
| 19 |
abcd = |
| 20 |
else: |
| 21 |
(abcd) = |
| 22 |
abcd = |
| 23 |
|
| 24 |
abcd |
| 25 |
|
| 26 |
abcd = 5 |
| 27 |
|
| 28 |
|
| 29 |
Abc = 3 |
| 30 |
|
| 31 |
|
| 32 |
class Abc(): |
| 33 |
|
| 34 |
Abc |
| 35 |
|
| 36 |
def Abc(self): |
| 37 |
Abc; self.c = 3 |
| 38 |
|
| 39 |
|
| 40 |
def a(self, Abc): |
| 41 |
|
| 42 |
Abc |
| 43 |
|
| 44 |
|
| 45 |
def self_test(self): |
| 46 |
|
| 47 |
self.b |
| 48 |
|
| 49 |
Abc.d.Abc |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
def blubi(): |
| 54 |
pass |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
@blubi |
| 59 |
def a(): pass |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
set_object_var = object() |
| 64 |
set_object_var.var = 1 |
| 65 |
|
| 66 |
def func(a, b): |
| 67 |
a = 12 |
| 68 |
|
| 69 |
c = a |
| 70 |
if True: |
| 71 |
|
| 72 |
c = b |
| 73 |
|
| 74 |
response = 5 |
| 75 |
|
| 76 |
response = HttpResponse(mimetype='application/pdf') |
| 77 |
response['Content-Disposition'] = 'attachment; filename=%s.pdf' % id |
| 78 |
response.write(pdf) |
| 79 |
|
| 80 |
response |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
import module_not_exists |
| 88 |
|
| 89 |
|
| 90 |
module_not_exists |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
from import_tree import rename1 |
| 95 |
|
| 96 |
|
| 97 |
rename1.abc |
| 98 |
|
| 99 |
|
| 100 |
from import_tree.rename1 import abc |
| 101 |
|
| 102 |
abc |
| 103 |
|
| 104 |
|
| 105 |
from import_tree.rename1 import abc |
| 106 |
|
| 107 |
|
| 108 |
from import_tree.rename1 import not_existing |
| 109 |
|
| 110 |
|
| 111 |
from not_existing import * |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
class TestMethods(object): |
| 118 |
|
| 119 |
def a_method(self): |
| 120 |
|
| 121 |
self.a_method() |
| 122 |
|
| 123 |
self.b_method() |
| 124 |
|
| 125 |
def b_method(self): |
| 126 |
self.b_method |
| 127 |
|
| 128 |
|
| 129 |
class TestClassVar(object): |
| 130 |
|
| 131 |
class_v = 1 |
| 132 |
def a(self): |
| 133 |
class_v = 1 |
| 134 |
|
| 135 |
|
| 136 |
self.class_v |
| 137 |
|
| 138 |
TestClassVar.class_v |
| 139 |
|
| 140 |
class_v |
| 141 |
|
| 142 |
class TestInstanceVar(): |
| 143 |
def a(self): |
| 144 |
|
| 145 |
self._instance_var = 3 |
| 146 |
|
| 147 |
def b(self): |
| 148 |
|
| 149 |
self._instance_var |
| 150 |
|
| 151 |
|
| 152 |
self() |
| 153 |
|
| 154 |
|
| 155 |
class NestedClass(): |
| 156 |
def __getattr__(self, name): |
| 157 |
return self |
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
NestedClass().instance |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
class Super(object): |
| 168 |
|
| 169 |
base_class = 1 |
| 170 |
|
| 171 |
class_var = 1 |
| 172 |
|
| 173 |
|
| 174 |
def base_method(self): |
| 175 |
|
| 176 |
self.base_var = 1 |
| 177 |
|
| 178 |
self.instance_var = 1 |
| 179 |
|
| 180 |
|
| 181 |
def just_a_method(self): pass |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
class TestClass(Super): |
| 186 |
|
| 187 |
class_var = 1 |
| 188 |
|
| 189 |
def x_method(self): |
| 190 |
|
| 191 |
|
| 192 |
TestClass.base_class |
| 193 |
|
| 194 |
self.base_class |
| 195 |
|
| 196 |
self.base_var |
| 197 |
|
| 198 |
TestClass.base_var |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
self.instance_var = 3 |
| 203 |
|
| 204 |
|
| 205 |
def just_a_method(self): |
| 206 |
|
| 207 |
self.instance_var |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
class TestProperty: |
| 214 |
|
| 215 |
@property |
| 216 |
|
| 217 |
def prop(self): |
| 218 |
return 1 |
| 219 |
|
| 220 |
def a(self): |
| 221 |
|
| 222 |
self.prop |
| 223 |
|
| 224 |
@property |
| 225 |
|
| 226 |
def rw_prop(self): |
| 227 |
return self._rw_prop |
| 228 |
|
| 229 |
|
| 230 |
@rw_prop.setter |
| 231 |
|
| 232 |
def rw_prop(self, value): |
| 233 |
self._rw_prop = value |
| 234 |
|
| 235 |
def b(self): |
| 236 |
|
| 237 |
self.rw_prop |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
def f(**kwargs): |
| 244 |
return kwargs |
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
if isinstance(j, int): |
| 251 |
|
| 252 |
j |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
class DynamicParam(): |
| 259 |
def foo(self): |
| 260 |
return |
| 261 |
|
| 262 |
def check(instance): |
| 263 |
|
| 264 |
instance.foo() |
| 265 |
|
| 266 |
check(DynamicParam()) |
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
import _sre |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
_sre |
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
import undefined |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
x = 32 |
| 293 |
|
| 294 |
[x for x in x] |
| 295 |
|
| 296 |
|
| 297 |
y = 32 |
| 298 |
|
| 299 |
[y for b in y] |
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
[x for x in something] |
| 304 |
|
| 305 |
[x for x in something] |
| 306 |
|
| 307 |
z = 3 |
| 308 |
|
| 309 |
{z:1 for z in something} |
| 310 |
|
| 311 |
{z:1 for z in something} |
| 312 |
|
| 313 |
|
| 314 |
[[x + nested_loopv2 for x in bar()] for nested_loopv2 in baz()] |
| 315 |
|
| 316 |
|
| 317 |
(("*" if abs(foo(x, nested_loopv1)) else " " for x in bar()) for nested_loopv1 in baz()) |
| 318 |
|
| 319 |
|
| 320 |
def whatever_func(): |
| 321 |
zzz = 3 |
| 322 |
if UNDEFINED: |
| 323 |
zzz = 5 |
| 324 |
if UNDEFINED2: |
| 325 |
|
| 326 |
zzz |
| 327 |
else: |
| 328 |
|
| 329 |
zzz |
| 330 |
zzz |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
def global_usage1(): |
| 337 |
|
| 338 |
my_global |
| 339 |
|
| 340 |
def global_definition(): |
| 341 |
|
| 342 |
global my_global |
| 343 |
|
| 344 |
my_global = 3 |
| 345 |
if WHATEVER: |
| 346 |
|
| 347 |
my_global = 4 |
| 348 |
|
| 349 |
def global_usage2() |
| 350 |
my_global |
| 351 |
|
| 352 |
def not_global(my_global): |
| 353 |
my_global |
| 354 |
|
| 355 |
class DefinitelyNotGlobal: |
| 356 |
def my_global(self): |
| 357 |
def my_global(self): |
| 358 |
pass |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
from stub_folder import with_stub |
| 365 |
|
| 366 |
with_stub.stub_function |
| 367 |
from stub_folder.with_stub_folder.nested_stub_only import in_stub_only |
| 368 |
|
| 369 |
in_stub_only |
| 370 |
from stub_folder.with_stub_folder.nested_with_stub import in_python |
| 371 |
|
| 372 |
in_python |
| 373 |
from stub_folder.with_stub_folder.nested_with_stub import in_both |
| 374 |
|
| 375 |
in_both |
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
usage_definition = 1 |
| 383 |
if False: |
| 384 |
|
| 385 |
usage_definition() |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
import socket |
| 392 |
|
| 393 |
socket.SocketIO |
| 394 |
some_socket = socket.SocketIO() |