start implementing a validation layer, refs #215
This commit is contained in:
14
test/property/validators/test_string_validator.py
Normal file
14
test/property/validators/test_string_validator.py
Normal file
@ -0,0 +1,14 @@
|
||||
from unittest import TestCase
|
||||
from owrx.property.validators import StringValidator
|
||||
|
||||
class StringValidatorTest(TestCase):
|
||||
def testPassesStrings(self):
|
||||
validator = StringValidator()
|
||||
self.assertTrue(validator.isValid("text"))
|
||||
|
||||
def testDoesntPassOthers(self):
|
||||
validator = StringValidator()
|
||||
self.assertFalse(validator.isValid(123))
|
||||
self.assertFalse(validator.isValid(-2))
|
||||
self.assertFalse(validator.isValid(.5))
|
||||
self.assertFalse(validator.isValid(object()))
|
Reference in New Issue
Block a user