Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_func_desc_manual(self):
# Example taken from hardCodedServer (cf. Schmidt and Li, 2009c)
animals = TypeDescription("animals", nuc_length=20, uc_length=28)
self.assertEqual(animals.nuc_length,20)
self.assertEqual(animals.uc_length,28)
animals.add_field(name=u'LION', field_type='RFCTYPE_CHAR', nuc_length=5, uc_length=10, nuc_offset=0, uc_offset=0)
animals.add_field(name=u'ELEPHANT', field_type='RFCTYPE_FLOAT', nuc_length=8, uc_length=8, decimals=16, nuc_offset=8, uc_offset=16)
animals.add_field(name=u'ZEBRA', field_type='RFCTYPE_INT', nuc_length=4, uc_length=4, nuc_offset=16, uc_offset=24)
i_dont_exist = FunctionDescription(u"I_DONT_EXIST")
i_dont_exist.add_parameter(name=u"DOG", parameter_type="RFCTYPE_INT",
direction="RFC_IMPORT", nuc_length=4, uc_length=4)
i_dont_exist.add_parameter(name=u"CAT", parameter_type="RFCTYPE_CHAR",
direction="RFC_IMPORT", nuc_length=5, uc_length=10)
i_dont_exist.add_parameter(name=u"ZOO", parameter_type="RFCTYPE_STRUCTURE",
direction="RFC_IMPORT", nuc_length=20, uc_length=28, type_description=animals)
i_dont_exist.add_parameter(name=u"BIRD", parameter_type="RFCTYPE_FLOAT",
direction="RFC_IMPORT", nuc_length=8, uc_length=8, decimals=16)
self.assertEqual(len(i_dont_exist.parameters), 4)
self.assertEqual(i_dont_exist.name, u"I_DONT_EXIST")
decimals=16,
nuc_length=8,
uc_length=8,
nuc_offset=8,
uc_offset=16,
)
animals.add_field(
name=u"ZEBRA",
field_type="RFCTYPE_INT",
nuc_length=4,
uc_length=4,
nuc_offset=16,
uc_offset=24,
)
func_desc = FunctionDescription("I_DONT_EXIST")
func_desc.add_parameter(
name=u"DOC",
field_type="RFCTYPE_INT",
direction="RFC_IMPORT",
nuc_length=4,
uc_length=4,
)
func_desc.add_parameter(
name=u"CAT",
field_type="RFCTYPE_CHAR",
direction="RFC_IMPORT",
nuc_length=5,
uc_length=10,
)
func_desc.add_parameter(
name=u"ZOO",