from app.core.password_denylist import is_denied_password, load_denylist


def test_password_denylist_blocks_common_password():
    assert is_denied_password("password123")


def test_password_denylist_loads_custom_entries(tmp_path, monkeypatch):
    denylist_file = tmp_path / "denylist.txt"
    denylist_file.write_text("# comment\nCustomBad1\n", encoding="utf-8")
    monkeypatch.setattr("app.core.password_denylist.settings.password_denylist_path", str(denylist_file))
    denylist = load_denylist()
    assert "custombad1" in denylist
    assert is_denied_password("CustomBad1")

