Description
Create comprehensive unit test suite for core framework functions.
Scope
smtp_vrfy_enum() - SMTP VRFY user enumeration
smtp_rcpt_enum() - SMTP RCPT TO validation
smtp_auth_test() - SMTP credential testing
pop3_auth_test() - POP3 authentication
imap_auth_test() - IMAP authentication
detect_dcs() - Multi-strategy DC discovery
build_ad_command() - Tool-specific command generation
execute_ad_tool() - Subprocess execution
discover_tools() - Tool availability detection
Requirements
- Use pytest framework
- Mock external services (SMTP, LDAP, DNS)
- Achieve 80%+ code coverage on core functions
- Test error scenarios and edge cases
- Test timeout handling
Files to Update
- Create:
tests/test_core.py
- Create:
tests/conftest.py (pytest fixtures)
- Create:
tests/mocks/ (mock services)
Success Criteria
- All tests pass locally
- CI/CD runs tests automatically
- Coverage report generated
Review update — 2026-09-11
PR #47 was merged as b4da033116c48e80c8480bdfd792adc638dc4d4b on September 11 at 06:02 UTC. This review is pinned to that main snapshot (version 1.2.4), not to a claim that the PR is still unmergeable. The PR's three test files landed unchanged. A local merge-tree check against pre-merge main d6abf50 completed without conflicts.
Reproduced result
Running tests/test_core.py with external process launches blocked by a patched subprocess.Popen raising OSError, and socket connections blocked, produced 16 passed, 1 failed. The timeout test received execution-error; the purported success test passed with that same execution error because it only checks for a status key. This was a guarded local run, not an unmodified CI run. Coverage was not measured.
Minimum test/CI follow-up
Remaining original acceptance criteria
The minimum corrections above do not complete this issue's broader scope. POP3/IMAP and DC-discovery coverage, a generated coverage report, and evidence for the original 80%+ core-function target remain outstanding. Keep this issue open until those criteria are verified. Coordinate broader CI/coverage work with #31.
Sources: PR #47, reviewed tests, reviewed implementation, reviewed CI.
Description
Create comprehensive unit test suite for core framework functions.
Scope
smtp_vrfy_enum()- SMTP VRFY user enumerationsmtp_rcpt_enum()- SMTP RCPT TO validationsmtp_auth_test()- SMTP credential testingpop3_auth_test()- POP3 authenticationimap_auth_test()- IMAP authenticationdetect_dcs()- Multi-strategy DC discoverybuild_ad_command()- Tool-specific command generationexecute_ad_tool()- Subprocess executiondiscover_tools()- Tool availability detectionRequirements
Files to Update
tests/test_core.pytests/conftest.py(pytest fixtures)tests/mocks/(mock services)Success Criteria
Review update — 2026-09-11
PR #47 was merged as
b4da033116c48e80c8480bdfd792adc638dc4d4bon September 11 at 06:02 UTC. This review is pinned to that main snapshot (version 1.2.4), not to a claim that the PR is still unmergeable. The PR's three test files landed unchanged. A local merge-tree check against pre-merge maind6abf50completed without conflicts.Reproduced result
Running
tests/test_core.pywith external process launches blocked by a patchedsubprocess.PopenraisingOSError, and socket connections blocked, produced 16 passed, 1 failed. The timeout test receivedexecution-error; the purported success test passed with that same execution error because it only checks for a status key. This was a guarded local run, not an unmodified CI run. Coverage was not measured.Minimum test/CI follow-up
smtp.rcpt(), notrcpt_to()orverify(), in the RCPT tests. Assert exact returned email addresses and recipient calls.smtplib.SMTPconstructor, rather than at login/verification.adpentest.core.subprocess.Popen, which execution actually uses. For success, configurepoll()andcommunicate(); assertcompleted, stdout, stderr and exit code.kill()and exact statustimeout. The existing builtinTimeoutErroron the unusedsubprocess.runmock does not exercise timeout handling.smtp_connect_test()with the socket fixture and assert actual return values; strengthen discovery assertions to exact available/unavailable sets.python -m pytest -q tests/test_core.pyin the existing Windows/Ubuntu CI matrix. The reviewed workflow only compiles and invokes a dry-run.Remaining original acceptance criteria
The minimum corrections above do not complete this issue's broader scope. POP3/IMAP and DC-discovery coverage, a generated coverage report, and evidence for the original 80%+ core-function target remain outstanding. Keep this issue open until those criteria are verified. Coordinate broader CI/coverage work with #31.
Sources: PR #47, reviewed tests, reviewed implementation, reviewed CI.