Skip to content

Added `env_bool` function, csv/kval functions now allow separator to be overriden, + more

Compare
Choose a tag to compare
@Someguy123 Someguy123 released this 19 Jul 13:03
· 94 commits to master since this release

New functions / code improvements

  • Added env_bool function to common.py for loading an environment var as a boolean
  • Added csvsplit parameter to parse/env_csv and keyval, to allow changing the item separator from ,
  • Added valsplit parameter to parse/env_keyval, to allow customising the separator between key's and value's from :

Documentation

  • Added PyDoc param's / return's for various functions, and fleshed out some others
  • Wrapped various docstring values such as True and 0 with backticks so they display better
  • Various small formatting improvements to existing docstrings
  • Added PrivexBaseCase and env_bool to the docs

Unit Testing

  • Refactored various attributes in test.py into the base class PrivexBaseClass
  • Added example to the PyDoc in tests.py showing how to run tests with pytest
  • Wrote new unit tests:
    • test_kval_custom_clean - Validates that parse_keyval works properly with custom valsplit/csvsplit
    • test_kval_custom_spaced - Validates that parse_keyval works properly with space padded values and custom valsplit/csvsplit
    • test_env_nonexist_bool, test_env_bool_true, test_env_bool_false - Validate that the new env_bool function returns the correct values.