Skip to content

Commit b201ecb

Browse files
committed
Fix test coverage for unset data_type.
1 parent 49450c3 commit b201ecb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/test_od.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ def test_domain(self):
171171
self.assertEqual(var.decode_raw(b"zero terminated\x00"), b"zero terminated\x00")
172172
self.assertEqual(var.encode_raw(b"testing"), b"testing")
173173

174+
def test_unset_data_type(self):
175+
var = od.ODVariable("Test unset", 0x1000)
176+
# data_type intentionally left at default (unset)
177+
with self.assertRaises(od.ObjectDictionaryError):
178+
var.encode_raw(42)
179+
174180

175181
class TestAlternativeRepresentations(unittest.TestCase):
176182

0 commit comments

Comments
 (0)