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

Method test_string_to_val_xml_element

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

Source from the content-addressed store, hash-verified

245 self.assertEqual(val_to_string(obj), string)
246
247 def test_string_to_val_xml_element(self):
248 string = "<p> titi toto </p>"
249 obj = ua.XmlElement(string)
250
251 self.assertEqual(string_to_val(string, ua.VariantType.XmlElement), obj)
252 self.assertEqual(val_to_string(obj), string)
253
254 b = struct_to_binary(obj)
255 obj2 = struct_from_binary(ua.XmlElement, ua.utils.Buffer(b))
256 self.assertEqual(obj, obj2)
257
258 def test_variant_dimensions(self):
259 l = [[[1.0, 1.0, 1.0, 1.0], [2.0, 2.0, 2.0, 2.0], [3.0, 3.0, 3.0, 3.0]], [[5.0, 5.0, 5.0, 5.0], [7.0, 8.0, 9.0, 01.0], [1.0, 1.0, 1.0, 1.0]]]

Callers

nothing calls this directly

Calls 4

string_to_valFunction · 0.90
val_to_stringFunction · 0.90
struct_to_binaryFunction · 0.90
struct_from_binaryFunction · 0.90

Tested by

no test coverage detected