1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-05 22:18:16 +08:00
bacpypes/tests/test_constructed_data/test_choice.py
2020-01-29 15:46:08 -05:00

28 lines
655 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Choice
-----------
"""
import unittest
from bacpypes.basetypes import Scale
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.primitivedata import Tag, TagList
# some debugging
_debug = 0
_log = ModuleLogger(globals())
@bacpypes_debugging
class TestScaleChoice(unittest.TestCase):
def test_scale_choice(self):
if _debug: TestScaleChoice._debug("test_scale_choice")
taglist = TagList([Tag(1, 1, 1, bytearray(b'\x00'))])
scale = Scale()
scale.decode(taglist)
self.assertDictEqual(scale.dict_contents(), {'integerScale': 0})