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

Method test_unknown_extension_object

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

Source from the content-addressed store, hash-verified

407 self.assertEqual(v1.VariantType, v2.VariantType)
408
409 def test_unknown_extension_object(self):
410 obj = ua.ExtensionObject()
411 obj.Body = b'example of data in custom format'
412 obj.TypeId = ua.NodeId.from_string('ns=3;i=42')
413 data = ua.utils.Buffer(extensionobject_to_binary(obj))
414 obj2 = extensionobject_from_binary(data)
415 self.assertEqual(type(obj2), ua.ExtensionObject)
416 self.assertEqual(obj2.TypeId, obj.TypeId)
417 self.assertEqual(obj2.Body, b'example of data in custom format')
418
419 def test_datetime(self):
420 now = datetime.utcnow()

Callers

nothing calls this directly

Calls 3

from_stringMethod · 0.45

Tested by

no test coverage detected