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
7d735413
Commit
7d735413
authored
Feb 23, 2021
by
oroulet
Committed by
oroulet
Mar 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix more tests
parent
00c1148a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
asyncua/ua/uaprotocol_hand.py
asyncua/ua/uaprotocol_hand.py
+1
-1
asyncua/ua/uatypes.py
asyncua/ua/uatypes.py
+0
-4
tests/test_unit.py
tests/test_unit.py
+9
-5
No files found.
asyncua/ua/uaprotocol_hand.py
View file @
7d735413
...
...
@@ -322,4 +322,4 @@ class XmlElement(FrozenClass):
:vartype Value: String
"""
Value
:
uatypes
.
String
Value
:
uatypes
.
String
=
""
asyncua/ua/uatypes.py
View file @
7d735413
...
...
@@ -614,10 +614,6 @@ class LocalizedText:
)
def
to_string
(
self
):
if
self
.
Text
is
None
:
return
""
if
self
.
Locale
is
None
:
return
self
.
Text
return
self
.
__str__
()
@
staticmethod
...
...
tests/test_unit.py
View file @
7d735413
...
...
@@ -131,7 +131,6 @@ def test_custom_structs_array(tmpdir):
data
=
struct_to_binary
(
v
)
v2
=
struct_from_binary
(
ns
[
"ArrayValueDataType"
],
ua
.
utils
.
Buffer
(
data
))
assert
v
.
NodeIdValue
==
v2
.
NodeIdValue
# print(v2.NodeIdValue)
def
test_nodeid_nsu
():
...
...
@@ -140,7 +139,6 @@ def test_nodeid_nsu():
n2
=
nodeid_from_binary
(
ua
.
utils
.
Buffer
(
data
))
assert
n1
==
n2
string
=
n1
.
to_string
()
print
(
string
)
n3
=
ua
.
NodeId
.
from_string
(
string
)
assert
n1
==
n3
...
...
@@ -237,7 +235,6 @@ def test_string_to_variant_localized_text_with_locale():
string_repr
=
f'LocalizedText(Encoding:3, Locale:
{
locale
}
, Text:
{
string
}
)'
obj
=
ua
.
LocalizedText
(
string
,
locale
)
assert
obj
==
string_to_val
(
string_repr
,
ua
.
VariantType
.
LocalizedText
)
breakpoint
()
assert
string_repr
==
val_to_string
(
obj
)
...
...
@@ -611,9 +608,7 @@ def test_text():
def
test_text_simple
():
t
=
ua
.
LocalizedText
(
'Root'
)
b
=
struct_to_binary
(
t
)
print
(
"BIN"
,
b
)
buf
=
ua
.
utils
.
Buffer
(
b
)
print
(
"BUF"
,
buf
)
t2
=
struct_from_binary
(
ua
.
LocalizedText
,
buf
)
assert
t
==
t2
...
...
@@ -742,3 +737,12 @@ def test_bin_data_type_def():
ad2
=
struct_from_binary
(
ua
.
AddNodesItem
,
ua
.
utils
.
Buffer
(
data
))
assert
ad
.
ParentNodeId
==
ad2
.
ParentNodeId
assert
ad
.
NodeAttributes
.
DisplayName
==
ad2
.
NodeAttributes
.
DisplayName
def
test_bin_datattributes
():
dta
=
ua
.
DataTypeAttributes
()
dta
.
DisplayName
=
ua
.
LocalizedText
(
"titi"
)
data
=
struct_to_binary
(
dta
)
dta2
=
struct_from_binary
(
ua
.
DataTypeAttributes
,
ua
.
utils
.
Buffer
(
data
))
assert
dta
.
DisplayName
==
dta2
.
DisplayName
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