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
0eff38d2
Commit
0eff38d2
authored
Apr 17, 2015
by
Olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add browse tests
parent
3bc1bb8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
tests.py
tests.py
+30
-1
No files found.
tests.py
View file @
0eff38d2
...
...
@@ -18,6 +18,8 @@ from opcua import Client
from
opcua
import
Server
from
opcua
import
uamethod
from
opcua
import
Event
from
opcua
import
ObjectIds
from
opcua
import
AttributeIds
port_num1
=
48410
port_num2
=
48430
...
...
@@ -198,7 +200,34 @@ class CommonTests(object):
self
.
assertEqual
(
ua
.
QualifiedName
(
'Objects'
,
0
),
objects
.
get_browse_name
())
nid
=
ua
.
NodeId
(
85
,
0
)
self
.
assertEqual
(
nid
,
objects
.
nodeid
)
def
test_browse
(
self
):
objects
=
self
.
opc
.
get_objects_node
()
obj
=
objects
.
add_object
(
4
,
"browsetest"
)
folder
=
obj
.
add_folder
(
4
,
"folder"
)
prop
=
obj
.
add_property
(
4
,
"property"
,
1
)
prop2
=
obj
.
add_property
(
4
,
"property2"
,
2
)
var
=
obj
.
add_variable
(
4
,
"variable"
,
3
)
obj2
=
obj
.
add_object
(
4
,
"obj"
)
alle
=
obj
.
get_children
()
self
.
assertTrue
(
prop
in
alle
)
self
.
assertTrue
(
prop2
in
alle
)
self
.
assertTrue
(
var
in
alle
)
self
.
assertTrue
(
folder
in
alle
)
self
.
assertFalse
(
obj
in
alle
)
props
=
obj
.
get_children
(
refs
=
ObjectIds
.
HasProperty
)
self
.
assertTrue
(
prop
in
props
)
self
.
assertTrue
(
prop2
in
props
)
self
.
assertFalse
(
var
in
props
)
self
.
assertFalse
(
folder
in
props
)
all_vars
=
obj
.
get_children
(
nodeclassmask
=
ua
.
NodeClass
.
Variable
)
self
.
assertTrue
(
prop
in
all_vars
)
self
.
assertTrue
(
var
in
all_vars
)
all_objs
=
obj
.
get_children
(
nodeclassmask
=
ua
.
NodeClass
.
Object
)
self
.
assertTrue
(
folder
in
all_objs
)
self
.
assertTrue
(
obj2
in
all_objs
)
self
.
assertFalse
(
var
in
all_objs
)
def
test_create_delete_subscription
(
self
):
o
=
self
.
opc
.
get_objects_node
()
v
=
o
.
add_variable
(
3
,
'SubscriptionVariable'
,
[
1
,
2
,
3
])
...
...
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