Commit Graph

26 Commits

Author SHA1 Message Date
71ea1823f4 Formatting w/ black 2022-04-24 10:41:35 +00:00
1a1760d45c Remove docstring here, it's not describing a class/function/method 2022-04-24 10:38:46 +00:00
5af27211f3 Add an initial stab at docstrings - enable docstring pylinter 2022-04-24 10:36:25 +00:00
c78bdf955a Don't ignore missing/unreadable files in test cases (pylint) 2022-04-22 19:40:30 +00:00
bc0310e088 Study and respond to PyLint
Add a reasonably tolerant .pylintrc and fix most pylint errors and
warnings.

------------------------------------------------------------------
Your code has been rated at 9.78/10
2022-04-22 19:32:38 +00:00
b7ff5479ac Fix lint errors with black 2022-04-22 13:10:16 +00:00
9ee9a32693 Test github push action 2022-04-22 13:07:04 +00:00
baaaaa67b5 Initial formatting run with Black. Integration tests and unit tests pass before and after this change. 2022-04-22 13:05:55 +00:00
e13694a566 Move to f-strings
Used:
$ flynt -a -tc . vppcfg

Execution time:                            0.216s
Files checked:                             24
Files modified:                            13
Character count reduction:                 632 (0.36%)

Per expression type:
Old style (`%`) expressions attempted:     209/211 (99.1%)
No `.format(...)` calls attempted.
No concatenations attempted.
F-string expressions created:              205

Ran an integration test before and after. No diffs.
2022-04-22 10:58:41 +00:00
1230e04c3e Refactor validators into a list, and add a custom validator function, which is passed the YAML as an argument, and will return (rv,msgs) to signal custom semantic validation results 2022-04-09 20:12:21 +00:00
95c08bbb29 Print an error if the number of errors is unexpected 2022-03-24 20:12:36 +00:00
2e2f63e1dd Fix reporting of YAML tests; send retval based on the bitflags of tests passing/failing 2022-03-24 15:15:26 +00:00
672dd65f11 Rename validator/ to config/ 2022-03-24 13:56:04 +00:00
c37faecd3f Buffer output, print when errors occur. Introduce debug/quiet flags 2022-03-22 20:11:32 +00:00
4cb07cf2da Add -d and -q flags 2022-03-22 19:52:19 +00:00
7bf940be0a Become a bit stricter: do full-line pattern match, and update unit tests to capture the full error output 2022-03-22 15:10:40 +00:00
551b06bb67 Move the output around - first print the unexpected messages, only then fail the assertions 2022-03-21 10:23:49 +00:00
ba22b1aad8 Refactor for *_get_by_name()
They now all return a list [ifname, iface]. If no interface was found
they return None,None. If one was found, they return the (string) name
and the dictionary with interface contents.
2022-03-21 08:47:05 +00:00
e46cf3d3a8 Make the test.errors.count value explicit, update tests which had an implicit count 2022-03-20 19:44:29 +00:00
1ff3ae95cc Fully move yamltest to unittest framework, assert errors instead of printing them 2022-03-20 19:27:23 +00:00
3291c60d9a Start refactoring YAML tests into unittest framework 2022-03-20 18:59:40 +00:00
2036795ef1 Move unittest YAML files into their own directory, pending more python unit tests in a followup commit 2022-03-20 16:59:13 +00:00
6d3de72c00 A completely empty config is a valid config 2022-03-15 20:52:09 +00:00
5c61259edd Add copyright and license 2022-03-13 21:08:32 +00:00
ec93195832 Print unittest description in case it's available 2022-03-13 19:58:17 +00:00
95c8be553f Simple unit tester, with a few example tests 2022-03-13 17:20:10 +00:00