Browse Source

Improve test coverage for interval.py

tags/nilmdb-2.0.0
Jim Paris 2 years ago
parent
commit
2d0c3f7868
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      tests/test_interval.py

+ 7
- 2
tests/test_interval.py View File

@@ -326,8 +326,13 @@ class TestInterval:
list(diff2(a,b,True))
list(diff2(a,b,False))

# Empty second set
eq_(nilmdb.utils.interval.set_difference(a, IntervalSet()), a)
# Fill out test coverage with a union operator (not implemented
# in interval.py, because nilmdb doesn't need it)
def union(a, b):
return nilmdb.utils.interval._interval_math_helper(
a, b, (lambda a, b: a or b), subset=False)
list(union(makeset("[---) "),
makeset(" [---)")))

# Empty second set
eq_(nilmdb.utils.interval.set_difference(a, IntervalSet()), a)


Loading…
Cancel
Save