Skip to content

Commit 7829bd1

Browse files
committed
Add tests for overriding epoch and type output
1 parent 7302ada commit 7829bd1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/test_reader.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import numpy as np
12
from pytest import mark
3+
from harp.io import REFERENCE_EPOCH, MessageType
24
from harp.reader import create_reader
35
from tests.params import DeviceSchemaParam
46

@@ -18,8 +20,13 @@
1820

1921
@mark.parametrize("schemaFile", testdata)
2022
def test_create_reader(schemaFile: DeviceSchemaParam):
21-
reader = create_reader(schemaFile.path)
23+
reader = create_reader(schemaFile.path, epoch=REFERENCE_EPOCH)
2224
schemaFile.assert_schema(reader.device)
2325

2426
whoAmI = reader.WhoAmI.read()
2527
assert reader.device.whoAmI == whoAmI.iloc[0, 0]
28+
assert whoAmI.index.dtype.type == np.datetime64
29+
30+
whoAmI = reader.WhoAmI.read(epoch=None, keep_type=True)
31+
assert whoAmI.index.dtype.type == np.float64
32+
assert whoAmI.iloc[0, -1] == MessageType.READ.name

0 commit comments

Comments
 (0)