Enhancement: Regression tests for Validate Input crash fixes (SH-1)

Open Beginner friendly
#59 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Find the existing tests named test_rejects_bad_address_or_number and test_rejects_wrong_type. Add the listed malformed address, timeout, and confidence inputs to the matching tests; the optional message shortening can be considered separately. Run the relevant tests and confirm SH-1 rejects these inputs without raising.

Written by the indexing model from the issue text.

Description

backend Low Priority

The review of the Validate Input PR found inputs that crashed validate_scope and validate_timeout. The crashes were fixed, but no tests were added, so nothing would catch them coming back. SH-1 must never raise on bad input.

  • Add "192.168.1.0 /24" and "192.168.1.0\t/24" (space or tab before the slash) to test_rejects_bad_address_or_number
  • Add "192.168.1.0/²" and "192.168.1.0/٢٤" (non-English digits after the slash) to the same test
  • Add 10400 and -10400 to the timeout's test_rejects_wrong_type
  • Add "٥٠" to the confidence's test_rejects_wrong_type
  • Optional: shorten long values in rejection messages (show() cuts them to about 40 characters), with a test

Milestone: M2. Raised in #26 PR.

Dominant language
Python
Stars
1
Forks
1
Avg merge
9h 46m
Merged PRs (30d)
35

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Bearkat-Professionals/Software-Engineering-Project

All issues in Bearkat-Professionals/Software-Engineering-Project

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.