| 1 |
"""Basic unit tests of Converters.""" |
| 2 |
# pylint: disable=import-error |
| 3 |
|
| 4 |
import unittest |
| 5 |
|
| 6 |
from foomuuri import Converters |
| 7 |
|
| 8 |
|
| 9 |
class TestConverters(unittest.TestCase): |
| 10 |
"""Test converter helpers.""" |
| 11 |
|
| 12 |
def test_str_yes_no_to_bool(self): |
| 13 |
"""Test str_yes_no_to_bool.""" |
| 14 |
self.assertTrue(Converters.str_yes_no_to_bool('yes')) |
| 15 |
self.assertFalse(Converters.str_yes_no_to_bool('no')) |
| 16 |
self.assertRaises(ValueError, Converters.str_yes_no_to_bool, '') |
| 17 |
self.assertRaises(ValueError, Converters.str_yes_no_to_bool, 'invalid') |