Add focused unit tests for the MikroTik parser helpers
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
Research direction
Start by reading parsers/mikrotik_parser.py and compare assertion patterns in tests/test_cisco_topology_validation.py. Create tests/test_mikrotik_parser.py with synthetic inputs covering normalization, key/value parsing, ping, NTP, and clock helpers, including PASS, FAIL, and WARNING contracts. Run the focused tests, full pytest, and python network_lab.py --task report-index; done means all acceptance criteria pass without device or credential access.
Written by the indexing model from the issue text.
Description
Context
parsers/mikrotik_parser.py provides pure helpers for output normalization, key/value parsing, ping results, NTP state, and clock state. The repository currently has no dedicated unit-test module for these helpers.
Focused tests will protect local parsing behavior without requiring RouterOS hardware, SSH, credentials, or private lab data.
Newcomer snapshot
- Difficulty: Beginner / Intermediate
- Scope: Small
- Primary area: Python / pytest parser unit tests
- Likely files: primarily a new
tests/test_mikrotik_parser.py; parser changes require a separately documented defect - Python required: Yes
- Node/npm required: No
- Physical hardware required: No
- Live device access required: No
- Credentials required: No
- External API/provider required: No
- Task-time network access required: No, after local dependencies are installed
- Start with:
python -m pytest tests/test_mikrotik_parser.py - Before completion: run the focused parser tests, full pytest, and
python network_lab.py --task report-index - Do not change: adapters, runners, SSH/device access, credentials handling, or parser implementation unless a separate clearly documented parser defect is discovered
Dependency installation may require internet access; the access fields above describe the task after local prerequisites are installed.
Scope
Add tests/test_mikrotik_parser.py using small, synthetic RouterOS-style strings.
This issue is test-only unless a separate, clearly documented parser defect is discovered during implementation.
Acceptance criteria
-
normalize_output()is covered for extra spaces, line breaks, and case normalization. -
parse_key_value_output()is covered for multiple keys and blank lines. -
parse_ping()is covered for successful, fully lost, malformed, and empty output. -
parse_ntp()is covered for synchronized and unsynchronized states. -
parse_clock()is covered for complete and missing timezone data. - Assertions verify the existing PASS, FAIL, and WARNING contracts.
- Every fixture is synthetic and contains no credentials or private infrastructure.
- Tests import only the parser module and do not invoke adapters, runners, SSH, or device access.
Suggested starting points
parsers/mikrotik_parser.pytests/test_cisco_topology_validation.pyas an example of parser-oriented assertions- New
tests/test_mikrotik_parser.py
Validation
Run:
python -m pytest tests/test_mikrotik_parser.pypython -m pytestpython network_lab.py --task report-index
Safety boundary
Use inline or committed synthetic text only. The tests must not read credentials, contact a device, import an execution adapter, open SSH, or require a physical MikroTik router.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 38m
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Robinlee0929/Network_Automation_Lab
-
enhancement good first issue
Difficulty 2/5 Half a day Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
All issues in Robinlee0929/Network_Automation_Lab
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100