major refactor and version change to 2.0

This commit is contained in:
Justin Bollinger
2026-01-26 13:32:37 -05:00
parent d36c5457b5
commit 01f4e55e85
23 changed files with 2409 additions and 1246 deletions

View File

@@ -0,0 +1,31 @@
def test_hashmob_connectivity_mocked(monkeypatch, capsys):
from hate_crack import hashmob_wordlist as hm
class FakeResp:
def raise_for_status(self):
return None
def json(self):
return [
{"type": "wordlist", "name": "List A", "information": "Info A"},
{"type": "wordlist", "name": "List B", "information": "Info B"},
{"type": "other", "name": "Ignore", "information": "Nope"},
]
def fake_get(url, headers=None, timeout=None):
assert url == "https://hashmob.net/api/v2/resource"
assert headers == {"api-key": "test-key"}
return FakeResp()
monkeypatch.setattr(hm, "get_api_key", lambda: "test-key")
monkeypatch.setattr(hm.requests, "get", fake_get)
result = hm.download_hashmob_wordlist_list()
assert len(result) == 2
assert result[0]["name"] == "List A"
assert result[1]["name"] == "List B"
captured = capsys.readouterr()
assert "Available Hashmob Wordlists:" in captured.out
assert "List A" in captured.out
assert "List B" in captured.out