Skip to content

Commit eb6098d

Browse files
committed
Explicitly test reading tunables
1 parent 66e5424 commit eb6098d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_magicbot_tunable.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Component:
2525
topic = nt.getTopic(name)
2626
assert topic.getTypeString() == type_str
2727
assert topic.genericSubscribe().get().value() == value
28+
assert getattr(component, name) == value
2829

2930
for name, value in [
3031
("rotation", geometry.Rotation2d()),
@@ -33,13 +34,15 @@ class Component:
3334
assert nt.getTopic(name).getTypeString() == f"struct:{struct_type.__name__}"
3435
topic = nt.getStructTopic(name, struct_type)
3536
assert topic.subscribe(None).get() == value
37+
assert getattr(component, name) == value
3638

3739
for name, struct_type, value in [
3840
("rotations", geometry.Rotation2d, [geometry.Rotation2d()]),
3941
]:
4042
assert nt.getTopic(name).getTypeString() == f"struct:{struct_type.__name__}[]"
4143
topic = nt.getStructArrayTopic(name, struct_type)
4244
assert topic.subscribe([]).get() == value
45+
assert getattr(component, name) == value
4346

4447

4548
def test_tunable_errors():

0 commit comments

Comments
 (0)