Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory_supervision
Commits
589444ff57c9
Commit
8769d4dd
authored
Sep 24, 2018
by
Aurélien Campéas
Browse files
test: prove that we can crash with some series editions
parent
4da65f230da7
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_supervision.py
View file @
589444ff
...
...
@@ -5,7 +5,7 @@ import pytest
import
pandas
as
pd
import
numpy
as
np
from
tshistory.testutil
import
assert_structures
from
tshistory.testutil
import
assert_structures
,
utcdt
from
tshistory_supervision.tsio
import
TimeSerie
...
...
@@ -47,6 +47,16 @@ def test_mercure_serie(engine, tsh):
"""
,
pd
.
read_sql
(
'select * from tsh.changeset_series'
,
engine
))
def
test_non_monotonic_autodiff
(
engine
,
tsh
):
s1
=
pd
.
Series
([
1
,
3
],
index
=
[
utcdt
(
2018
,
1
,
1
),
utcdt
(
2018
,
1
,
3
)])
s2
=
pd
.
Series
([
2
,
3.1
],
index
=
[
utcdt
(
2018
,
1
,
2
),
utcdt
(
2018
,
1
,
3
)])
tsh
.
insert
(
engine
,
s1
,
'nmdiff'
,
'Babar'
)
with
pytest
.
raises
(
AssertionError
)
as
err
:
tsh
.
insert
(
engine
,
s2
,
'nmdiff'
,
'Celeste'
)
assert
err
.
value
.
args
[
0
]
==
'The index is not monotonic'
def
test_differential
(
engine
,
tsh
):
ts_begin
=
genserie
(
datetime
(
2010
,
1
,
1
),
'D'
,
10
)
tsh
.
insert
(
engine
,
ts_begin
,
'ts_test'
,
'test'
)
...
...
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