diff --git a/.gitignore b/.gitignore index 5f9c2fc..96fd286 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ aliases/*/src docs/_build docs/_static docs/templates +.coverage # changes during CD/CI -aliases/*/pyproject.toml \ No newline at end of file +aliases/*/pyproject.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index d42d190..b4ba99a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.11.2 + ++ increase test coverage of `validators` + ## 0.11.1 + make `yesno()` accept boolean types diff --git a/src/suou/__init__.py b/src/suou/__init__.py index 9097a9b..c3c8724 100644 --- a/src/suou/__init__.py +++ b/src/suou/__init__.py @@ -37,7 +37,7 @@ from .redact import redact_url_password from .http import WantsContentType from .color import chalk, WebColor -__version__ = "0.11.1" +__version__ = "0.11.2" __all__ = ( 'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue', diff --git a/tests/test_validators.py b/tests/test_validators.py index 0064128..2d3cc89 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -1,7 +1,8 @@ import unittest -from suou.validators import yesno +from suou.calendar import not_greater_than +from suou.validators import not_less_than, yesno class TestValidators(unittest.TestCase): def setUp(self): @@ -21,4 +22,17 @@ class TestValidators(unittest.TestCase): self.assertTrue(yesno('2')) self.assertTrue(yesno('o')) self.assertFalse(yesno('oFF')) - self.assertFalse(yesno('no')) \ No newline at end of file + self.assertFalse(yesno('no')) + self.assertFalse(yesno(False)) + self.assertTrue(yesno(True)) + self.assertFalse(yesno('')) + + def test_not_greater_than(self): + self.assertTrue(not_greater_than(5)(5)) + self.assertTrue(not_greater_than(5)(3)) + self.assertFalse(not_greater_than(3)(8)) + + def test_not_less_than(self): + self.assertTrue(not_less_than(5)(5)) + self.assertFalse(not_less_than(5)(3)) + self.assertTrue(not_less_than(3)(8)) \ No newline at end of file