Integrate attr libraries
This commit is contained in:
parent
fb2e79b807
commit
472fd45ce2
9 changed files with 200 additions and 265 deletions
|
|
@ -1,19 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from hypothesis import event, given
|
||||
from traces import TimeSeries
|
||||
|
||||
import mtl
|
||||
from mtl.hypothesis import MetricTemporalLogicStrategy
|
||||
|
||||
|
||||
@given(MetricTemporalLogicStrategy)
|
||||
def test_invertable_repr(phi):
|
||||
event(str(phi))
|
||||
assert str(phi) == str(mtl.parse(str(phi)))
|
||||
TS = {
|
||||
"ap1": TimeSeries([(0, True), (0.1, True), (0.2, False)]),
|
||||
"ap2": TimeSeries([(0, False), (0.2, True), (0.5, False)]),
|
||||
"ap3": TimeSeries([(0, True), (0.1, True), (0.3, False)]),
|
||||
"ap4": TimeSeries([(0, False), (0.1, False), (0.3, False)]),
|
||||
"ap5": TimeSeries([(0, False), (0.1, False), (0.3, True)]),
|
||||
}
|
||||
|
||||
|
||||
@given(MetricTemporalLogicStrategy)
|
||||
def test_hash_inheritance(phi):
|
||||
assert hash(repr(phi)) == hash(phi)
|
||||
def test_stablizing_repr(phi):
|
||||
for _ in range(10):
|
||||
phi, phi2 = mtl.parse(str(phi)), phi
|
||||
|
||||
assert phi == phi2
|
||||
|
||||
|
||||
def test_sugar_smoke():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue