MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / test_extension_object

Method test_extension_object

tests/tests_unit.py:396–407  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

394 self.assertEqual(v.Value, v2.Value)
395
396 def test_extension_object(self):
397 obj = ua.UserNameIdentityToken()
398 obj.UserName = "admin"
399 obj.Password = b"pass"
400 obj2 = extensionobject_from_binary(ua.utils.Buffer(extensionobject_to_binary(obj)))
401 self.assertEqual(type(obj), type(obj2))
402 self.assertEqual(obj.UserName, obj2.UserName)
403 self.assertEqual(obj.Password, obj2.Password)
404 v1 = ua.Variant(obj)
405 v2 = variant_from_binary(ua.utils.Buffer(variant_to_binary(v1)))
406 self.assertEqual(type(v1), type(v2))
407 self.assertEqual(v1.VariantType, v2.VariantType)
408
409 def test_unknown_extension_object(self):
410 obj = ua.ExtensionObject()

Callers

nothing calls this directly

Calls 4

variant_from_binaryFunction · 0.90
variant_to_binaryFunction · 0.90

Tested by

no test coverage detected