import unittest
from odml import Property, Section, Document, DType


class TestProperty(unittest.TestCase):

    def setUp(self):
        pass

    def test_value(self):
        p = Property("property", 100)
        assert(p.value[0] == 100)

    def test_bool_conversion(self):

        p = Property(name='received', value=[3, 0, 1, 0, 8])
        assert(p.dtype == 'int')
        p.dtype = DType.boolean
        assert(p.dtype == 'boolean')
        assert(p.value == [True, False, True, False, True])

        q = Property(name='sent', value=['False', True, 'TRUE', '0'])
        assert(q.dtype == 'string')
        q.dtype = DType.boolean
        assert(q.dtype == 'boolean')
        assert(q.value == [False, True, True, False])


    def test_name(self):
        pass

    def test_parent(self):
        pass

    def test_dtype(self):
        pass

    def test_path(self):
        pass

if __name__ == "__main__":
    print("TestProperty")
    tp = TestProperty()
    tp.test_value()

import unittest
from odml import Property, Section, Document


class TestProperty(unittest.TestCase):

    def setUp(self):
        pass

    def test_value(self):
        p = Property("property", 100)
        assert(p.value[0] == 100)

    def test_name(self):
        pass

    def test_parent(self):
        pass

    def test_dtype(self):
        pass

    def test_path(self):
        pass

if __name__ == "__main__":
    print("TestProperty")
    tp = TestProperty()
    tp.test_value()

--- 
+++ 
@@ -1,5 +1,5 @@
 import unittest
-from odml import Property, Section, Document
+from odml import Property, Section, Document, DType
 
 
 class TestProperty(unittest.TestCase):
@@ -10,6 +10,21 @@
     def test_value(self):
         p = Property("property", 100)
         assert(p.value[0] == 100)
+
+    def test_bool_conversion(self):
+
+        p = Property(name='received', value=[3, 0, 1, 0, 8])
+        assert(p.dtype == 'int')
+        p.dtype = DType.boolean
+        assert(p.dtype == 'boolean')
+        assert(p.value == [True, False, True, False, True])
+
+        q = Property(name='sent', value=['False', True, 'TRUE', '0'])
+        assert(q.dtype == 'string')
+        q.dtype = DType.boolean
+        assert(q.dtype == 'boolean')
+        assert(q.value == [False, True, True, False])
+
 
     def test_name(self):
         pass
Add tests for boolean conversion
