No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_boolean.py 821B

12345678910111213141516171819202122232425262728
  1. import unittest
  2. from lodel.leapi.datahandlers.datas import Boolean, Varchar, Integer
  3. class BooleanTestCase(unittest.TestCase):
  4. def test_boolean_check_data_value(self):
  5. test_boolean = Boolean()
  6. # correct values
  7. for test_value in [True, False]:
  8. _, error = test_boolean.check_data_value(test_value)
  9. self.assertIsNone(error)
  10. # incorrect values
  11. for test_value in ['ok', 'True', 'False']:
  12. _, error = test_boolean.check_data_value(test_value)
  13. self.assertIsNotNone(error)
  14. def test_can_override(self):
  15. test_boolean = Boolean()
  16. test_varchar = Varchar()
  17. test_int = Integer()
  18. self.assertFalse(test_boolean.can_override(test_varchar))
  19. self.assertFalse(test_boolean.can_override(test_int))