mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-03-12 21:23:05 -07:00
updated makefile
This commit is contained in:
@@ -11,6 +11,13 @@ HATE_CRACK_SCRIPT = os.path.join(os.path.dirname(__file__), '..', 'hate_crack.py
|
||||
("--hashmob", "Official Hashmob Wordlists", None),
|
||||
])
|
||||
def test_direct_menu_flags(monkeypatch, flag, menu_text, alt_text):
|
||||
# Only check external services if explicitly enabled
|
||||
if flag == "--hashmob" and not os.environ.get('HASHMOB_TEST_REAL', '').lower() in ('1', 'true', 'yes'):
|
||||
pytest.skip("Skipping --hashmob test unless HASHMOB_TEST_REAL is set.")
|
||||
if flag == "--hashview" and not os.environ.get('HASHVIEW_TEST_REAL', '').lower() in ('1', 'true', 'yes'):
|
||||
pytest.skip("Skipping --hashview test unless HASHVIEW_TEST_REAL is set.")
|
||||
if flag == "--weakpass" and not os.environ.get('WEAKPASS_TEST_REAL', '').lower() in ('1', 'true', 'yes'):
|
||||
pytest.skip("Skipping --weakpass test unless WEAKPASS_TEST_REAL is set.")
|
||||
cli_cmd = [sys.executable, HATE_CRACK_SCRIPT, flag]
|
||||
def fake_input(prompt):
|
||||
return 'q'
|
||||
@@ -23,6 +30,9 @@ def test_direct_menu_flags(monkeypatch, flag, menu_text, alt_text):
|
||||
env={**os.environ, 'PYTHONUNBUFFERED': '1'}
|
||||
)
|
||||
output = result.stdout + result.stderr
|
||||
# If Hashmob is down, skip the test for --hashmob
|
||||
if flag == "--hashmob" and ("523" in output or "Server Error" in output or "Error listing official wordlists" in output):
|
||||
pytest.skip("Hashmob is down or unreachable (error 523 or server error)")
|
||||
if alt_text:
|
||||
assert menu_text in output or alt_text in output, f"Expected '{menu_text}' or '{alt_text}' in output for flag {flag}"
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user