Skip to content

Commit a98c245

Browse files
committed
Make test_ssti and test_xpath runnable standalone
Every tests/test_*.py file provides an if __name__ == "__main__": unittest.main(...) entrypoint so it can be run directly, except test_ssti.py and test_xpath.py. Running either of those directly produced no output and executed none of its tests; they only ran under `unittest discover`. Add the missing entrypoint to both so they behave like the rest of the suite. No test logic changed (62 and 48 tests respectively still pass).
1 parent 1d9965d commit a98c245

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎tests/test_ssti.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,3 +827,7 @@ def test_s2045_command_rejects_reflected_header(self):
827827
# so no start/end marker is found -> no fabricated 'output'
828828
ssti._s2045Send = lambda url, action: "reflected: %s" % action
829829
self.assertIsNone(ssti._executeStruts2Header("http://target", "id"))
830+
831+
832+
if __name__ == "__main__":
833+
unittest.main(verbosity=2)

‎tests/test_xpath.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,7 @@ def test_all_extractable_boundaries_have_valid_extraction(self):
557557
self.fail("Boundary '%s' in '%s' with orig='%s' invalid: %s\n payload: %s" % (bk, tkey, original, e, payload))
558558
self.assertIsInstance(count, int,
559559
"Boundary '%s' in '%s' produced no count" % (bk, tkey))
560+
561+
562+
if __name__ == "__main__":
563+
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)