1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-05 22:18:16 +08:00

adjust the tests to expect the InvalidTag exception

This commit is contained in:
Joel Bender 2015-09-25 22:27:14 -04:00
parent 3c3ad2fe7f
commit 60cba9c949
13 changed files with 93 additions and 70 deletions

View File

@ -9,6 +9,8 @@ Test Primitive Bit String
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import BitString, Tag from bacpypes.primitivedata import BitString, Tag
# some debugging # some debugging
@ -130,15 +132,15 @@ class TestBitString(unittest.TestCase):
assert obj.value == [0, 0, 0, 0, 0, 0, 1] assert obj.value == [0, 0, 0, 0, 0, 0, 1]
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
BitString(tag) BitString(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
BitString(tag) BitString(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
BitString(tag) BitString(tag)
def test_bit_string_copy(self): def test_bit_string_copy(self):

View File

@ -9,6 +9,8 @@ Test Primitive Data Boolean
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Boolean, Tag from bacpypes.primitivedata import Boolean, Tag
# some debugging # some debugging
@ -98,15 +100,15 @@ class TestBoolean(unittest.TestCase):
assert obj.value == 1 assert obj.value == 1
tag = Tag(Tag.applicationTagClass, Tag.integerAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.integerAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Boolean(tag) Boolean(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Boolean(tag) Boolean(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Boolean(tag) Boolean(tag)
def test_boolean_copy(self): def test_boolean_copy(self):

View File

@ -9,7 +9,9 @@ Test Primitive Data Character String
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import CharacterString, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import CharacterString, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -98,15 +100,15 @@ class TestCharacterString(unittest.TestCase):
assert obj.value == '' assert obj.value == ''
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
CharacterString(tag) CharacterString(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
CharacterString(tag) CharacterString(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
CharacterString(tag) CharacterString(tag)
def test_character_string_copy(self): def test_character_string_copy(self):
@ -119,8 +121,8 @@ class TestCharacterString(unittest.TestCase):
def test_character_string_endec(self): def test_character_string_endec(self):
if _debug: TestCharacterString._debug("test_character_string_endec") if _debug: TestCharacterString._debug("test_character_string_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = CharacterString(character_string_tag('')) obj = CharacterString(character_string_tag(''))
character_string_endec("", '00') character_string_endec("", '00')
character_string_endec("abc", '00616263') character_string_endec("abc", '00616263')

View File

@ -9,6 +9,8 @@ Test Primitive Data Date
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Date, Tag from bacpypes.primitivedata import Date, Tag
# some debugging # some debugging
@ -96,15 +98,15 @@ class TestDate(unittest.TestCase):
assert obj.value == (1, 2, 3, 4) assert obj.value == (1, 2, 3, 4)
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Date(tag) Date(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Date(tag) Date(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Date(tag) Date(tag)
def test_date_copy(self): def test_date_copy(self):
@ -118,8 +120,8 @@ class TestDate(unittest.TestCase):
def test_date_endec(self): def test_date_endec(self):
if _debug: TestInteger._debug("test_date_endec") if _debug: TestInteger._debug("test_date_endec")
# with self.assertRaises(IndexError): with self.assertRaises(InvalidTag):
# obj = Date(date_tag('')) obj = Date(date_tag(''))
def old_tests(self): def old_tests(self):
self.test_values = [ self.test_values = [

View File

@ -11,7 +11,9 @@ import struct
import math import math
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Double, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Double, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -105,15 +107,15 @@ class TestDouble(unittest.TestCase):
assert obj.value == 1.0 assert obj.value == 1.0
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Double(tag) Double(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Double(tag) Double(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Double(tag) Double(tag)
def test_double_copy(self): def test_double_copy(self):
@ -126,8 +128,8 @@ class TestDouble(unittest.TestCase):
def test_double_endec(self): def test_double_endec(self):
if _debug: TestDouble._debug("test_double_endec") if _debug: TestDouble._debug("test_double_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = Double(double_tag('')) obj = Double(double_tag(''))
double_endec(0, '0000000000000000') double_endec(0, '0000000000000000')
double_endec(1, '3ff0000000000000') double_endec(1, '3ff0000000000000')

View File

@ -9,7 +9,9 @@ Test Primitive Data Enumerated
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Enumerated, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Enumerated, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -98,15 +100,15 @@ class TestEnumerated(unittest.TestCase):
assert obj.value == 1 assert obj.value == 1
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Enumerated(tag) Enumerated(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Enumerated(tag) Enumerated(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Enumerated(tag) Enumerated(tag)
def test_enumerated_copy(self): def test_enumerated_copy(self):
@ -119,8 +121,8 @@ class TestEnumerated(unittest.TestCase):
def test_enumerated_endec(self): def test_enumerated_endec(self):
if _debug: TestEnumerated._debug("test_enumerated_endec") if _debug: TestEnumerated._debug("test_enumerated_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = Enumerated(enumerated_tag('')) obj = Enumerated(enumerated_tag(''))
enumerated_endec(0, '00') enumerated_endec(0, '00')
enumerated_endec(1, '01') enumerated_endec(1, '01')

View File

@ -9,7 +9,9 @@ Test Primitive Data Integer
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Integer, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Integer, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -99,15 +101,15 @@ class TestInteger(unittest.TestCase):
assert obj.value == 1 assert obj.value == 1
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Integer(tag) Integer(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Integer(tag) Integer(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Integer(tag) Integer(tag)
def test_integer_copy(self): def test_integer_copy(self):
@ -120,8 +122,8 @@ class TestInteger(unittest.TestCase):
def test_integer_endec(self): def test_integer_endec(self):
if _debug: TestInteger._debug("test_integer_endec") if _debug: TestInteger._debug("test_integer_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = Integer(integer_tag('')) obj = Integer(integer_tag(''))
integer_endec(0, '00') integer_endec(0, '00')
integer_endec(1, '01') integer_endec(1, '01')

View File

@ -9,7 +9,9 @@ Test Primitive Data Object Identifier
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import ObjectIdentifier, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import ObjectIdentifier, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -100,15 +102,15 @@ class TestObjectIdentifier(unittest.TestCase):
assert obj.value == ('pulseConverter', 3) assert obj.value == ('pulseConverter', 3)
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectIdentifier(tag) ObjectIdentifier(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectIdentifier(tag) ObjectIdentifier(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectIdentifier(tag) ObjectIdentifier(tag)
def test_object_identifier_copy(self): def test_object_identifier_copy(self):
@ -121,9 +123,8 @@ class TestObjectIdentifier(unittest.TestCase):
def test_object_identifier_endec(self): def test_object_identifier_endec(self):
if _debug: TestObjectIdentifier._debug("test_object_identifier_endec") if _debug: TestObjectIdentifier._debug("test_object_identifier_endec")
### this should raise a DecodingError with self.assertRaises(InvalidTag):
# with self.assertRaises(DecodingError): obj = ObjectIdentifier(object_identifier_tag(''))
# obj = ObjectIdentifier(object_identifier_tag(''))
# test standard types # test standard types
object_identifier_endec(('analogInput', 0), '00000000') object_identifier_endec(('analogInput', 0), '00000000')

View File

@ -9,8 +9,9 @@ Test Primitive Data ObjectType
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import ObjectType, Tag, DecodingError, \
expand_enumerations from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import ObjectType, Tag, expand_enumerations
# some debugging # some debugging
_debug = 0 _debug = 0
@ -143,15 +144,15 @@ class TestObjectType(unittest.TestCase):
assert obj.value == 'analogOutput' assert obj.value == 'analogOutput'
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectType(tag) ObjectType(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectType(tag) ObjectType(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
ObjectType(tag) ObjectType(tag)
def test_object_type_copy(self): def test_object_type_copy(self):
@ -165,8 +166,8 @@ class TestObjectType(unittest.TestCase):
def test_object_type_endec(self): def test_object_type_endec(self):
if _debug: TestObjectType._debug("test_object_type_endec") if _debug: TestObjectType._debug("test_object_type_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = ObjectType(object_type_tag('')) obj = ObjectType(object_type_tag(''))
object_type_endec('analogInput', '00') object_type_endec('analogInput', '00')
object_type_endec('analogOutput', '01') object_type_endec('analogOutput', '01')

View File

@ -10,6 +10,8 @@ import unittest
import struct import struct
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import OctetString, Tag from bacpypes.primitivedata import OctetString, Tag
# some debugging # some debugging
@ -98,15 +100,15 @@ class TestOctetString(unittest.TestCase):
assert obj.value == xtob('00') assert obj.value == xtob('00')
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
OctetString(tag) OctetString(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
OctetString(tag) OctetString(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
OctetString(tag) OctetString(tag)
def test_octet_string_copy(self): def test_octet_string_copy(self):

View File

@ -11,7 +11,9 @@ import struct
import math import math
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Real, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Real, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -106,15 +108,15 @@ class TestReal(unittest.TestCase):
assert obj.value == 1.0 assert obj.value == 1.0
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Real(tag) Real(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Real(tag) Real(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Real(tag) Real(tag)
def test_real_copy(self): def test_real_copy(self):
@ -127,8 +129,8 @@ class TestReal(unittest.TestCase):
def test_real_endec(self): def test_real_endec(self):
if _debug: TestReal._debug("test_real_endec") if _debug: TestReal._debug("test_real_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = Real(real_tag('')) obj = Real(real_tag(''))
real_endec(0, '00000000') real_endec(0, '00000000')
real_endec(1, '3f800000') real_endec(1, '3f800000')

View File

@ -9,6 +9,8 @@ Test Primitive Data Time
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Time, Tag from bacpypes.primitivedata import Time, Tag
# some debugging # some debugging
@ -103,15 +105,15 @@ class TestTime(unittest.TestCase):
assert obj.value == (1, 2, 3, 4) assert obj.value == (1, 2, 3, 4)
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Time(tag) Time(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Time(tag) Time(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Time(tag) Time(tag)
def test_time_copy(self): def test_time_copy(self):
@ -131,9 +133,8 @@ class TestTime(unittest.TestCase):
def test_time_endec(self): def test_time_endec(self):
if _debug: TestTime._debug("test_time_endec") if _debug: TestTime._debug("test_time_endec")
### this should raise a decoding error with self.assertRaises(InvalidTag):
# with self.assertRaises(IndexError): obj = Time(time_tag(''))
# obj = Time(time_tag(''))
time_endec((0, 0, 0, 0), '00000000') time_endec((0, 0, 0, 0), '00000000')
time_endec((1, 0, 0, 0), '01000000') time_endec((1, 0, 0, 0), '01000000')

View File

@ -9,7 +9,9 @@ Test Primitive Data Unsigned
import unittest import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Unsigned, Tag, DecodingError
from bacpypes.errors import InvalidTag
from bacpypes.primitivedata import Unsigned, Tag
# some debugging # some debugging
_debug = 0 _debug = 0
@ -98,15 +100,15 @@ class TestUnsigned(unittest.TestCase):
assert obj.value == 1 assert obj.value == 1
tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob('')) tag = Tag(Tag.applicationTagClass, Tag.booleanAppTag, 0, xtob(''))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Unsigned(tag) Unsigned(tag)
tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff')) tag = Tag(Tag.contextTagClass, 0, 1, xtob('ff'))
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Unsigned(tag) Unsigned(tag)
tag = Tag(Tag.openingTagClass, 0) tag = Tag(Tag.openingTagClass, 0)
with self.assertRaises(ValueError): with self.assertRaises(InvalidTag):
Unsigned(tag) Unsigned(tag)
def test_unsigned_copy(self): def test_unsigned_copy(self):
@ -119,8 +121,8 @@ class TestUnsigned(unittest.TestCase):
def test_unsigned_endec(self): def test_unsigned_endec(self):
if _debug: TestUnsigned._debug("test_unsigned_endec") if _debug: TestUnsigned._debug("test_unsigned_endec")
# with self.assertRaises(DecodingError): with self.assertRaises(InvalidTag):
# obj = Unsigned(unsigned_tag('')) obj = Unsigned(unsigned_tag(''))
unsigned_endec(0, '00') unsigned_endec(0, '00')
unsigned_endec(1, '01') unsigned_endec(1, '01')