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
4e7c60e2
Commit
4e7c60e2
authored
Jun 03, 2021
by
oroulet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add TypeCheck server side
parent
9acce704
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
asyncua/server/address_space.py
asyncua/server/address_space.py
+7
-0
tests/test_common.py
tests/test_common.py
+1
-1
tests/test_permissions.py
tests/test_permissions.py
+1
-1
No files found.
asyncua/server/address_space.py
View file @
4e7c60e2
...
...
@@ -706,6 +706,13 @@ class AddressSpace:
if
attval
is
None
:
return
ua
.
StatusCode
(
ua
.
StatusCodes
.
BadAttributeIdInvalid
)
if
value
.
Value
.
VariantType
!=
attval
.
value
.
Value
.
VariantType
:
if
value
.
Value
.
VariantType
==
ua
.
VariantType
.
Null
or
attval
.
value
.
Value
.
VariantType
==
ua
.
VariantType
.
Null
:
pass
else
:
_logger
.
critical
(
"Write refused: Variant: %s with type %s does not have expected type: %s"
,
value
.
Value
,
value
.
Value
.
VariantType
,
attval
.
value
.
Value
.
VariantType
)
return
ua
.
StatusCode
(
ua
.
StatusCodes
.
BadTypeMismatch
)
old
=
attval
.
value
attval
.
value
=
value
cbs
=
[]
...
...
tests/test_common.py
View file @
4e7c60e2
...
...
@@ -538,7 +538,7 @@ async def test_add_exception(opc):
async
def
test_negative_value
(
opc
):
o
=
opc
.
opc
.
nodes
.
objects
v
=
await
o
.
add_variable
(
3
,
'VariableNegativeValue'
,
4
)
v
=
await
o
.
add_variable
(
3
,
'VariableNegativeValue'
,
4
.0
)
await
v
.
write_value
(
-
4.54
)
assert
-
4.54
==
await
v
.
read_value
()
await
opc
.
opc
.
delete_nodes
([
v
])
...
...
tests/test_permissions.py
View file @
4e7c60e2
...
...
@@ -91,7 +91,7 @@ async def test_permissions_admin(srv_crypto_one_cert):
objects
=
clt
.
nodes
.
objects
child
=
await
objects
.
get_child
([
'0:MyObject'
,
'0:MyVariable'
])
await
child
.
read_value
()
await
child
.
set_value
(
42
)
await
child
.
set_value
(
42
.0
)
async
def
test_permissions_user
(
srv_crypto_one_cert
):
...
...
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