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
6e1a56aa
Commit
6e1a56aa
authored
Apr 12, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for HistorySQL
parent
6d5ca772
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
29 deletions
+2
-29
tests/tests.py
tests/tests.py
+2
-0
tests/tests_common.py
tests/tests_common.py
+0
-29
No files found.
tests/tests.py
View file @
6e1a56aa
...
...
@@ -17,6 +17,8 @@ from tests_cmd_lines import TestCmdLines
from
tests_server
import
TestServer
from
tests_client
import
TestClient
from
tests_unit
import
TestUnit
from
tests_history
import
TestHistory
from
tests_history
import
TestHistorySQL
if
CRYPTOGRAPHY_AVAILABLE
:
from
tests_crypto_connect
import
TestCryptoConnect
...
...
tests/tests_common.py
View file @
6e1a56aa
...
...
@@ -867,32 +867,3 @@ class CommonTests(object):
self
.
assertTrue
(
len
(
endpoints
)
>
0
)
self
.
assertTrue
(
endpoints
[
0
].
EndpointUrl
.
startswith
(
"opc.tcp://"
))
def
test_history_read
(
self
):
o
=
self
.
srv
.
get_objects_node
()
vals
=
[
i
for
i
in
range
(
20
)]
var
=
o
.
add_variable
(
3
,
"history_var"
,
0
)
self
.
srv
.
iserver
.
enable_history
(
var
,
period
=
None
,
count
=
10
)
for
i
in
vals
:
var
.
set_value
(
i
)
time
.
sleep
(
1
)
now
=
datetime
.
now
()
old
=
now
-
timedelta
(
days
=
6
)
res
=
var
.
read_raw_history
(
None
,
now
,
2
)
self
.
assertEqual
(
len
(
res
),
2
)
self
.
assertEqual
(
res
[
-
1
].
Value
.
Value
,
vals
[
-
1
])
res
=
var
.
read_raw_history
(
old
,
now
,
0
)
self
.
assertEqual
(
len
(
res
),
20
)
self
.
assertEqual
(
res
[
-
1
].
Value
.
Value
,
vals
[
-
1
])
self
.
assertEqual
(
res
[
0
].
Value
.
Value
,
vals
[
0
])
res
=
var
.
read_raw_history
(
old
,
now
,
5
)
self
.
assertEqual
(
len
(
res
),
5
)
self
.
assertEqual
(
res
[
-
1
].
Value
.
Value
,
vals
[
4
])
self
.
assertEqual
(
res
[
0
].
Value
.
Value
,
vals
[
0
])
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