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
af20c1bb
Commit
af20c1bb
authored
Mar 29, 2015
by
Olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add subscirption delete, create test
parent
509f82cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
opcua/internal_server.py
opcua/internal_server.py
+2
-1
opcua/subscription_server.py
opcua/subscription_server.py
+6
-3
tests.py
tests.py
+3
-3
No files found.
opcua/internal_server.py
View file @
af20c1bb
...
...
@@ -180,6 +180,7 @@ class InternalSession(object):
def
delete_subscriptions
(
self
,
ids
):
for
i
in
ids
:
if
i
in
self
.
subscriptions
:
self
.
subscriptions
.
remove
(
i
)
return
self
.
submgr
.
delete_subscriptions
(
ids
)
...
...
opcua/subscription_server.py
View file @
af20c1bb
...
...
@@ -83,6 +83,9 @@ class SubscriptionManager(Thread):
with
self
.
_lock
:
res
=
[]
for
i
in
ids
:
if
not
i
in
self
.
subscriptions
:
res
.
append
(
ua
.
StatusCode
(
ua
.
StatusCodes
.
BadSubscriptionsIdInvalid
))
else
:
sub
=
self
.
subscriptions
.
pop
(
i
)
sub
.
stop
()
res
.
append
(
ua
.
StatusCode
())
...
...
tests.py
View file @
af20c1bb
...
...
@@ -203,7 +203,7 @@ class CommonTests(object):
self
.
assertEqual
(
ua
.
QualifiedName
(
'Objects'
,
0
),
objects
.
get_name
())
nid
=
ua
.
NodeId
(
85
,
0
)
self
.
assertEqual
(
nid
,
objects
.
nodeid
)
'''
def
test_create_delete_subscription
(
self
):
o
=
self
.
opc
.
get_objects_node
()
v
=
o
.
add_variable
(
3
,
'SubscriptionVariable'
,
[
1
,
2
,
3
])
...
...
@@ -212,7 +212,7 @@ class CommonTests(object):
time
.
sleep
(
0.1
)
sub
.
unsubscribe
(
handle
)
sub
.
delete
()
'''
#def test_subscribe_events(self):
#sub = self.opc.create_subscription(100, sclt)
#handle = sub.subscribe_events()
...
...
@@ -498,7 +498,7 @@ class TestServer(unittest.TestCase, CommonTests):
if
__name__
==
'__main__'
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
logging
.
basicConfig
(
level
=
logging
.
WARN
)
globalserver
=
ServerProcess
()
#server process will be started by client tests
try
:
sclt
=
SubHandler
()
...
...
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