Commit 5b34e271 authored by oroulet's avatar oroulet Committed by oroulet

use tripple quote in generated code to be even more robust

parent 0b866d06
......@@ -176,7 +176,7 @@ class {struct_name}{base_class}:
{struct_name} structure autogenerated from StructureDefinition object
'''
data_type = ua.NodeId.from_string('{data_type.to_string()}')
data_type = ua.NodeId.from_string('''{data_type.to_string()}''')
"""
......
......@@ -1576,11 +1576,12 @@ async def test_alias(opc):
await var.write_value(v)
val = await var.read_value()
async def test_custom_struct_with_strange_chars(opc):
idx = 4
await new_struct(opc.opc, ua.StringNodeId('Toto"æ', 99), ua.QualifiedName("Siemens", 99), [
new_struct_field("MyBool", ua.VariantType.Boolean),
new_struct_field('MyBool', ua.VariantType.Boolean),
new_struct_field("MyUInt32", ua.VariantType.UInt32, array=True),
])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment