Skip to content

Commit

Permalink
test coverage for observation iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed May 13, 2017
1 parent 5b9fa66 commit 3b315cd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/jams_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,20 @@ def test_annotation_eq():
assert not (ann1 == ann2)


def test_annotation_iterator():

data = [dict(time=0, duration=0.5, value='one', confidence=0.2),
dict(time=1, duration=1, value='two', confidence=0.5)]

namespace = 'tag_open'

ann = jams.Annotation(namespace, data=data)

for obs, obs_raw in zip(ann, data):
assert isinstance(obs, jams.Observation)
assert obs._asdict() == obs_raw, (obs, obs_raw)


def test_annotation_interval_values():

data = dict(time=[0.0, 1.0],
Expand Down

0 comments on commit 3b315cd

Please sign in to comment.