MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / TestDelattr834

Class TestDelattr834

tests/unit/test_group_a_rules.py:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82# ============================================================
83
84class TestDelattr834:
85 def test_tainted_attr_name_fires(self):
86 code = """
87 attr = request.GET.get('field')
88 delattr(obj, attr)
89 """
90 assert fires(code, "DELATTR834"), "DELATTR834 must fire: tainted attr name to delattr"
91
92 def test_constant_attr_safe(self):
93 code = """
94 delattr(obj, 'cache')
95 """
96 assert not fires(code, "DELATTR834"), "DELATTR834 must NOT fire for constant attr"
97
98
99# ============================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected