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
af65d7dd
Commit
af65d7dd
authored
May 08, 2019
by
Christian Bergmiller
Committed by
oroulet
May 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse string Guid NodeId as UUID
parent
59f1dd2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
asyncua/ua/uatypes.py
asyncua/ua/uatypes.py
+1
-1
tests/test_common.py
tests/test_common.py
+10
-1
No files found.
asyncua/ua/uatypes.py
View file @
af65d7dd
...
...
@@ -355,7 +355,7 @@ class NodeId(object):
identifier
=
v
elif
k
==
"g"
:
ntype
=
NodeIdType
.
Guid
identifier
=
v
identifier
=
uuid
.
UUID
(
f"urn:uuid:
{
v
}
"
)
elif
k
==
"b"
:
ntype
=
NodeIdType
.
ByteString
identifier
=
v
...
...
tests/test_common.py
View file @
af65d7dd
...
...
@@ -11,7 +11,7 @@ from datetime import datetime
from
datetime
import
timedelta
import
math
from
asyncua
import
ua
,
uamethod
from
asyncua
import
ua
,
uamethod
,
Node
from
asyncua.common
import
ua_utils
from
asyncua.common.methods
import
call_method_full
from
asyncua.common.copy_node_util
import
copy_node
...
...
@@ -955,3 +955,12 @@ async def test_data_type_to_variant_type(opc):
}
for
dt
,
vdt
in
test_data
.
items
():
assert
vdt
==
await
ua_utils
.
data_type_to_variant_type
(
opc
.
opc
.
get_node
(
ua
.
NodeId
(
dt
)))
async
def
test_guid_node_id
():
"""
Test that a Node can be instantiated with a GUID string and that the NodeId ca be converted to binary.
"""
node
=
Node
(
None
,
"ns=4;g=35d5f86f-2777-4550-9d48-b098f5ee285c"
)
binary_node_id
=
ua
.
ua_binary
.
nodeid_to_binary
(
node
.
nodeid
)
assert
type
(
binary_node_id
)
is
bytes
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