We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7c1b01 commit 52421ceCopy full SHA for 52421ce
2 files changed
tests/data/device.yml
@@ -1,7 +1,7 @@
1
%YAML 1.1
2
---
3
# yaml-language-server: $schema=https://raw.githubusercontent.com/harp-tech/reflex-generator/main/schema/device.json
4
-device: TestDevice
+device: device
5
whoAmI: 0000
6
firmwareVersion: "0.1"
7
hardwareTargets: "0.1"
tests/test_reader.py
@@ -0,0 +1,17 @@
+from pytest import mark
+from harp.reader import create_reader
+from tests.params import DeviceSchemaParam
+
+testdata = [
+ DeviceSchemaParam(
+ path="data/device.yml",
8
+ expected_whoAmI=0,
9
+ expected_registers=["DigitalInputMode"],
10
+ )
11
+]
12
13
14
+@mark.parametrize("schemaFile", testdata)
15
+def test_create_reader(schemaFile: DeviceSchemaParam):
16
+ reader = create_reader(schemaFile.path)
17
+ schemaFile.assert_schema(reader.device)
0 commit comments