Skip to content

Commit

Permalink
magicbot: Test empty string array feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Jun 23, 2024
1 parent e0d63e9 commit 31dc5dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_magicbot_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def get_float(self) -> float:
def get_ints(self) -> typing.Sequence[int]:
return (0,)

@magicbot.feedback
def get_empty_strings(self) -> typing.Sequence[str]:
return ()

def execute(self):
pass

Expand All @@ -56,7 +60,7 @@ def createObjects(self):
pass


def test_collect_feedbacks_with_type_hints():
def test_feedbacks_with_type_hints():
robot = Robot()
robot.robotInit()
nt = ntcore.NetworkTableInstance.getDefault().getTable("components")
Expand All @@ -70,6 +74,7 @@ def test_collect_feedbacks_with_type_hints():
("type_hinted/int", "int", 0),
("type_hinted/float", "double", 0.5),
("type_hinted/ints", "int[]", [0]),
("type_hinted/empty_strings", "string[]", []),
):
topic = nt.getTopic(name)
assert topic.getTypeString() == type_str
Expand Down

0 comments on commit 31dc5dd

Please sign in to comment.