Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
8a1ae358
Commit
8a1ae358
authored
Oct 09, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more xml tests
parent
63ac4499
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/tests_xml.py
tests/tests_xml.py
+20
-0
No files found.
tests/tests_xml.py
View file @
8a1ae358
...
...
@@ -37,6 +37,10 @@ class XmlTests(object):
def
test_xml_export
(
self
):
o
=
self
.
opc
.
nodes
.
objects
.
add_object
(
2
,
"xmlexportobj"
)
m
=
o
.
add_method
(
2
,
"callme"
,
func
,
[
ua
.
VariantType
.
Double
,
ua
.
VariantType
.
String
],
[
ua
.
VariantType
.
Float
])
v
=
o
.
add_variable
(
3
,
"myxmlvar"
,
6.78
,
ua
.
VariantType
.
Float
)
a
=
o
.
add_variable
(
3
,
"myxmlvar"
,
[
6
,
1
],
ua
.
VariantType
.
UInt16
)
a2
=
o
.
add_variable
(
3
,
"myxmlvar"
,
[[]],
ua
.
VariantType
.
ByteString
)
print
(
a
.
get_value_rank
)
# set an arg dimension to a list to test list export
inputs
=
m
.
get_child
(
"InputArguments"
)
val
=
inputs
.
get_value
()
...
...
@@ -51,5 +55,21 @@ class XmlTests(object):
self
.
opc
.
delete_nodes
(
nodes
)
self
.
opc
.
import_xml
(
"export.xml"
)
# now see if our nodes are here
val
=
inputs
.
get_value
()
self
.
assertEqual
(
len
(
val
),
2
)
#self.assertEqual(val[0].ArrayDimensions, [2, 2]) # seems broken
self
.
assertEqual
(
v
.
get_value
(),
6.78
)
self
.
assertEqual
(
v
.
get_data_type
(),
ua
.
NodeId
(
ua
.
ObjectIds
.
Float
))
self
.
assertEqual
(
a
.
get_value
(),
[
6
,
1
])
self
.
assertEqual
(
a
.
get_data_type
(),
ua
.
NodeId
(
ua
.
ObjectIds
.
UInt16
))
self
.
assertIn
(
a
.
get_value_rank
(),
(
0
,
1
))
self
.
assertEqual
(
a2
.
get_value
(),
[[]])
self
.
assertEqual
(
a2
.
get_data_type
(),
ua
.
NodeId
(
ua
.
ObjectIds
.
ByteString
))
self
.
assertIn
(
a2
.
get_value_rank
(),
(
0
,
2
))
self
.
assertEqual
(
a2
.
get_attribute
(
ua
.
AttributeIds
.
ArrayDimensions
).
Value
.
Value
,
[
1
,
0
])
# seems broken
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment