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

Method test_variant_array_dim

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

Source from the content-addressed store, hash-verified

549 self.assertEqual(v.VariantType, ua.VariantType.Double)
550
551 def test_variant_array_dim(self):
552 v = ua.Variant([1, 2, 3, 4, 5, 6], dimensions=[2, 3])
553 self.assertEqual(v.Value[1], 2)
554 v2 = variant_from_binary(ua.utils.Buffer(variant_to_binary(v)))
555 self.assertEqual(_reshape(v.Value, (2, 3)), v2.Value)
556 self.assertEqual(v.VariantType, v2.VariantType)
557 self.assertEqual(v.Dimensions, v2.Dimensions)
558 self.assertEqual(v2.Dimensions, [2, 3])
559
560 def test_text(self):
561 t1 = ua.LocalizedText('Root')

Callers

nothing calls this directly

Calls 3

variant_from_binaryFunction · 0.90
variant_to_binaryFunction · 0.90
_reshapeFunction · 0.90

Tested by

no test coverage detected