Skip to content

Commit

Permalink
Merge 8a56401 into 4737180
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Aug 28, 2020
2 parents 4737180 + 8a56401 commit 60efc08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ocs/ocs_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def verify_message_data_type(value):
'data' dictionary value published (see Feed.publish_message for details).
"""
valid_types = (float, int)
valid_types = (float, int, str)

# multi-sample check
if isinstance(value, list):
Expand Down
8 changes: 3 additions & 5 deletions tests/test_ocs_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def test_valid_multi_sample_input(self):
test_feed.publish_message(test_message)

def test_str_single_sample_input(self):
"""Passing a string, even just one, should cause an error upon
publishing.
"""We should also now be able to pass strings.
"""
mock_agent = MagicMock()
Expand All @@ -63,11 +62,10 @@ def test_str_single_sample_input(self):
}
}

with pytest.raises(TypeError):
test_feed.publish_message(test_message)
test_feed.publish_message(test_message)

def test_str_multi_sample_input(self):
"""Passing multiple points, including multiple invalid datatypes,
"""Passing multiple points, including invalid datatypes,
should cause a TypeError upon publishing.
"""
Expand Down

0 comments on commit 60efc08

Please sign in to comment.