Added parse_util test case.

This commit is contained in:
Fabio Caccamo 2020-02-20 17:17:22 +01:00
parent c1eeb5671e
commit 0e306d5307
1 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
from benedict.dicts.parse import parse_util
import unittest
class parse_util_test_case(unittest.TestCase):
def test_parse_bool(self):
f = parse_util.parse_bool
self.assertTrue(f(1))
self.assertTrue(f(True))
self.assertTrue(f('1'))
self.assertTrue(f('True'))
self.assertTrue(f('Yes'))
self.assertTrue(f('Ok'))
self.assertTrue(f('On'))
self.assertFalse(f(None))
self.assertFalse(f(0))
self.assertFalse(f(False))
self.assertFalse(f('0'))
self.assertFalse(f('False'))
self.assertFalse(f('No'))
self.assertFalse(f('Ko'))
self.assertFalse(f('Off'))
def test_parse_datetime(self):
# TODO
pass
def test_parse_decimal(self):
# TODO
pass
def test_parse_dict(self):
# TODO
pass
def test_parse_float(self):
# TODO
pass
def test_parse_email(self):
# TODO
pass
def test_parse_int(self):
# TODO
pass
def test_parse_list(self):
# TODO
pass
def test_parse_phonenumber(self):
# TODO
pass
def test_parse_slug(self):
# TODO
pass
def test_parse_str(self):
# TODO
pass