fix: resolve test_crtsh.py import for plugins/ directory
Same importlib fix as test_username.py -- load plugins.crtsh from file path since plugins/ is not a Python package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,19 @@
|
|||||||
"""Tests for the crt.sh certificate transparency plugin."""
|
"""Tests for the crt.sh certificate transparency plugin."""
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import sys
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from plugins.crtsh import (
|
# plugins/ is not a Python package -- load the module from file path
|
||||||
|
_spec = importlib.util.spec_from_file_location(
|
||||||
|
"plugins.crtsh", Path(__file__).resolve().parent.parent / "plugins" / "crtsh.py",
|
||||||
|
)
|
||||||
|
_mod = importlib.util.module_from_spec(_spec)
|
||||||
|
sys.modules[_spec.name] = _mod
|
||||||
|
_spec.loader.exec_module(_mod)
|
||||||
|
|
||||||
|
from plugins.crtsh import ( # noqa: E402
|
||||||
deduplicate,
|
deduplicate,
|
||||||
format_result,
|
format_result,
|
||||||
is_expired,
|
is_expired,
|
||||||
|
|||||||
Reference in New Issue
Block a user