-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lowercase capture groups #1983
base: master
Are you sure you want to change the base?
Conversation
mjbear
commented
Jan 19, 2025
•
edited
Loading
edited
- Fix lowercase capture groups (should be uppercase per project guidelines)
- In these same (lowercase cap grp) templates only, switch literal whitespace to whitespace regexes
I suggest adding a test in the templates that check that all the values are in uppercase. It shouldn't be too difficult. Just checking the value will force that the TextFSM templates fails. |
Good idea. |
Whenever i have some i can add the tests cases, it should extremely easy :)
El dj., 30 de gen. 2025, 14:09, Michael Bear ***@***.***> va
escriure:
… I suggest adding a test in the templates that check that all the values
are in uppercase. It shouldn't be too difficult. Just checking the value
will force that the TextFSM templates fails.
Good idea.
I'm pulling this to a Draft while I work on test cases. 😀
—
Reply to this email directly, view it on GitHub
<#1983 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANQ2UZWQBFH7BVZPG6G7DUD2NIQADAVCNFSM6AAAAABVO74L2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRUGQ3TGMZSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
😅 |
Sure! Sorry, i was just trying to help :). I can do then some code review
😜
El dv., 31 de gen. 2025, 2:05, Michael Bear ***@***.***> va
escriure:
… Whenever i have some i can add the tests cases, it should extremely easy :)
😅
I appreciate the nudge, haha.
I'll own these "lowercase" test cases for the initial development and take
your code review suggestions. Sound good? 😁
—
Reply to this email directly, view it on GitHub
<#1983 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANQ2UZQ5L4RBAXGTVNZM5JD2NLD4HAVCNFSM6AAAAABVO74L2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRWGA3DANBUGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@evilmonkey19 I made it happen today ... so you'll find a new test case. 🎉 😀 |
It looks awesome! I like your trick of the |
😎👍 |
@mjbear I absolutely LOVE this and the test set up. I just want to verify, that when the test fails, the system continues to test until all of the files have been looked at right? |
Yes - it continues on with the parsed data checks as well. I began using this and it failed on IKEv1 and IPv6 (plus a couple of other items) initially until I converted them to uppercase. Example: https://github.com/networktocode/tree/master/ntc_templates/templates/cisco_asa_show_running-config_all_crypto_map.textfsm I checked the GH Actions and apparently I caught the lowercase ones before I pushed the commit to GitHub. I checked out commit c4e61ad, pulled a copy of the new Python test from commit 324fd65, and re-ran tests to provide output. Note the failed and passed numbers in the summary. 🙂 🎯 Edit: @jvanderaa This is to say that IKEv1 does not pass the new lowercase test case, but continues parsing. ============================================================== short test summary info ===============================================================
FAILED tests/test_capture_group_case.py::test_uppercase_capture_group[./ntc_templates/templates/oneaccess_oneos_show_voice_voice-port_pri_all.textfsm] - AssertionError: assert False
FAILED tests/test_capture_group_case.py::test_uppercase_capture_group[./ntc_templates/templates/cisco_asa_show_running-config_all_crypto_map.textfsm] - AssertionError: assert False
FAILED tests/test_capture_group_case.py::test_uppercase_capture_group[./ntc_templates/templates/cisco_xr_show_lldp_neighbors_detail.textfsm] - AssertionError: assert False
FAILED tests/test_capture_group_case.py::test_uppercase_capture_group[./ntc_templates/templates/cisco_xr_show_processes_cpu.textfsm] - AssertionError: assert False
=============================================== 4 failed, 3324 passed, 18 warnings in 91.60s (0:01:31) =============================================== I didn't change any capture group names (just case) so this wouldn't be a breaking change, would it? |