[GEMINI] Refactor test suite structure for new helpers and config modules
This commit is contained in:
14
tests/test_helpers.py
Normal file
14
tests/test_helpers.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# tests/test_helpers.py
|
||||
from ctf.helpers import check_for_flag
|
||||
|
||||
# {{{ test_check_for_flag
|
||||
def test_check_for_flag():
|
||||
"""
|
||||
Verifies that check_for_flag extracts multiple matching flags or returns empty list.
|
||||
"""
|
||||
res = check_for_flag("flag{one} and flag{two}")
|
||||
assert set(res) == {"flag{one}", "flag{two}"}
|
||||
res_custom = check_for_flag("custom{first} custom{second}", r"custom\{[a-z]+\}")
|
||||
assert set(res_custom) == {"custom{first}", "custom{second}"}
|
||||
assert check_for_flag("no flag matches here") == []
|
||||
# }}}
|
||||
Reference in New Issue
Block a user