From 0e306d530774071b3d34eb6f8c7fccbcfb6fba1d Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Thu, 20 Feb 2020 17:17:22 +0100 Subject: [PATCH] Added parse_util test case. --- tests/dicts/parse/test_parse_util.py | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 tests/dicts/parse/test_parse_util.py diff --git a/tests/dicts/parse/test_parse_util.py b/tests/dicts/parse/test_parse_util.py new file mode 100644 index 0000000..9e80652 --- /dev/null +++ b/tests/dicts/parse/test_parse_util.py @@ -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