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

Class TestRand810

tests/unit/test_group_a_rules.py:207–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205# ============================================================
206
207class TestRand810:
208 def test_tainted_seed_fires(self):
209 code = """
210 import random
211 seed = request.GET.get('seed')
212 random.seed(seed)
213 """
214 assert fires(code, "RAND810"), "RAND810 must fire: tainted seed to random.seed()"
215
216 def test_constant_seed_safe(self):
217 code = """
218 import random
219 random.seed(42)
220 """
221 assert not fires(code, "RAND810"), "RAND810 must NOT fire for constant seed"
222
223
224# ============================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected