0.11.2 add tests for not_*_than()
This commit is contained in:
parent
3af9d6c9fb
commit
eca16d781f
4 changed files with 23 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -29,6 +29,7 @@ aliases/*/src
|
||||||
docs/_build
|
docs/_build
|
||||||
docs/_static
|
docs/_static
|
||||||
docs/templates
|
docs/templates
|
||||||
|
.coverage
|
||||||
|
|
||||||
# changes during CD/CI
|
# changes during CD/CI
|
||||||
aliases/*/pyproject.toml
|
aliases/*/pyproject.toml
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.11.2
|
||||||
|
|
||||||
|
+ increase test coverage of `validators`
|
||||||
|
|
||||||
## 0.11.1
|
## 0.11.1
|
||||||
|
|
||||||
+ make `yesno()` accept boolean types
|
+ make `yesno()` accept boolean types
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ from .redact import redact_url_password
|
||||||
from .http import WantsContentType
|
from .http import WantsContentType
|
||||||
from .color import chalk, WebColor
|
from .color import chalk, WebColor
|
||||||
|
|
||||||
__version__ = "0.11.1"
|
__version__ = "0.11.2"
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
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):
|
class TestValidators(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
@ -21,4 +22,17 @@ class TestValidators(unittest.TestCase):
|
||||||
self.assertTrue(yesno('2'))
|
self.assertTrue(yesno('2'))
|
||||||
self.assertTrue(yesno('o'))
|
self.assertTrue(yesno('o'))
|
||||||
self.assertFalse(yesno('oFF'))
|
self.assertFalse(yesno('oFF'))
|
||||||
self.assertFalse(yesno('no'))
|
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))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue