Skip to content

R35-T047: Publish a runnable example for main (main.py) - #88

Open
challengerthe026-maker wants to merge 1 commit into
S-AI-Projects:mainfrom
challengerthe026-maker:student/e26b07f0577/R35-T047
Open

challengerthe026-maker wants to merge 1 commit into
S-AI-Projects:mainfrom
challengerthe026-maker:student/e26b07f0577/R35-T047

Conversation

@challengerthe026-maker

Copy link
Copy Markdown

Description

This PR publishes executable documentation and runnable worked examples for main in Password Strength Checker/main.py, documenting the decisive input-to-output state transitions, providing backward-compatible programmatic invocation, and verifying the examples in automated tests.

Related Issue

Fixes: #47

Type of Change

  • Bug Fix
  • New Feature
  • UI/UX Improvement
  • Performance Improvement
  • Tests
  • Documentation
  • Refactoring / Maintenance
  • CI/CD

Changes Made

  • Added a detailed docstring to main detailing preconditions, decisive state transitions, and executable worked examples for both weak and strong password classifications.
  • Supported optional parameters password and predict_fn with seamless fallback to input() and model.model.predict to preserve full backward compatibility for interactive CLI users while allowing headless testability.
  • Added unit tests in Password Strength Checker/test_main.py executing the documented worked examples and verifying displayed stdout and return values for smallest input ("a" -> 0) and ordinary input ("MyP@ssw0rd!2026" -> 2).
  • Implemented work/R35-T047/check.py and work/R35-T047/evidence.md with complete verification logs and automated pass/fail checks.

Screenshots / Recordings

There are no UI changes.

Testing

  1. python3 work/R35-T047/check.py: PASS (all assertion groups passed, worked examples verified, ran 3 unittest cases).
  2. FORCE_WRONG=1 python3 work/R35-T047/check.py: FAIL (correctly caught deliberate mismatch and exited with code 1).
  3. python3 -m unittest discover -s "Password Strength Checker" -p "test_*.py": PASS (Ran 3 tests, OK).

Checklist

  • I have tested my changes locally.
  • I have added or updated tests, if needed.
  • I have updated documentation, if needed.
  • I have followed the project's coding guidelines.
  • I have run the relevant tests and checks.
  • I have addressed previous review feedback, if applicable.

Additional Notes

Work evidence and standalone check runner are located under work/R35-T047/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant