mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
fix: add skip guards for missing runtime artifacts in e2e/integration tests
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"""End-to-end tests for markov brute force attack flow."""
|
||||
|
||||
import os
|
||||
import gzip
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
@@ -18,6 +17,9 @@ class TestMarkovE2E:
|
||||
# Setup paths
|
||||
main.hate_path = Path(__file__).resolve().parents[1]
|
||||
main.hcatHcstat2genBin = "hcstat2gen.bin"
|
||||
bin_path = main.hate_path / "hashcat-utils" / "bin" / "hcstat2gen.bin"
|
||||
if not bin_path.is_file():
|
||||
pytest.skip(f"hcstat2gen.bin not compiled: {bin_path}")
|
||||
|
||||
# Create test wordlist
|
||||
wordlist = tmp_path / "wordlist.txt"
|
||||
@@ -44,6 +46,9 @@ class TestMarkovE2E:
|
||||
# Setup paths
|
||||
main.hate_path = Path(__file__).resolve().parents[1]
|
||||
main.hcatHcstat2genBin = "hcstat2gen.bin"
|
||||
bin_path = main.hate_path / "hashcat-utils" / "bin" / "hcstat2gen.bin"
|
||||
if not bin_path.is_file():
|
||||
pytest.skip(f"hcstat2gen.bin not compiled: {bin_path}")
|
||||
|
||||
# Create test wordlist (gzipped)
|
||||
wordlist_plain = tmp_path / "wordlist.txt"
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
import json
|
||||
import pytest
|
||||
|
||||
|
||||
def test_pipal_executable_and_runs(tmp_path):
|
||||
# Read pipalPath from config.json
|
||||
config_path = os.path.join(os.path.dirname(__file__), "..", "config.json")
|
||||
if not os.path.isfile(config_path):
|
||||
pytest.skip("config.json not present (worktree or fresh checkout)")
|
||||
with open(config_path, "r") as f:
|
||||
config = json.load(f)
|
||||
pipal_path = config.get("pipalPath")
|
||||
if not pipal_path or not os.path.isfile(pipal_path):
|
||||
import pytest
|
||||
|
||||
pytest.skip("pipalPath not configured or file missing")
|
||||
|
||||
if not os.access(pipal_path, os.X_OK):
|
||||
|
||||
@@ -7,6 +7,8 @@ from hate_crack.api import HashviewAPI
|
||||
|
||||
def get_hashview_config():
|
||||
config_path = os.path.join(os.path.dirname(__file__), "..", "config.json")
|
||||
if not os.path.isfile(config_path):
|
||||
pytest.skip("config.json not present (worktree or fresh checkout)")
|
||||
with open(config_path, "r") as f:
|
||||
config = json.load(f)
|
||||
hashview_url = config.get("hashview_url")
|
||||
|
||||
Reference in New Issue
Block a user