We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03843b4 commit 2b83f29Copy full SHA for 2b83f29
mydata_did/v1_0/utils/tests/__init__.py
mydata_did/v1_0/utils/tests/test_utils.py
@@ -0,0 +1,22 @@
1
+from asynctest import TestCase as AsyncTestCase
2
+
3
+from ..util import str_to_bool
4
5
+class TestDataAgreementV1Record(AsyncTestCase):
6
7
+ def test_str_to_bool(self):
8
9
+ assert str_to_bool("True") == True
10
+ assert str_to_bool("t") == True
11
+ assert str_to_bool("1") == True
12
+ assert str_to_bool("true") == True
13
14
+ assert str_to_bool("False") == False
15
+ assert str_to_bool("f") == False
16
+ assert str_to_bool("0") == False
17
+ assert str_to_bool("false") == False
18
19
+ with self.assertRaises(ValueError) as ctx:
20
+ str_to_bool("")
21
22
+ self.assertTrue("Cannot convert string to boolean" in str(ctx.exception))
0 commit comments