Skip to content

Commit

Permalink
explicitly set all values before test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed May 22, 2024
1 parent 1b245a7 commit 365da94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clickplc/tests/test_driver.py
Original file line number Diff line number Diff line change
@@ -112,8 +112,8 @@ async def test_c_roundtrip(plc_driver):
@pytest.mark.asyncio
async def test_df_roundtrip(plc_driver):
"""Confirm df floats are read back correctly after being set."""
await plc_driver.set('df2', 2.0)
await plc_driver.set('df3', [3.0, 4.0])
await plc_driver.set('df1', 0.0)
await plc_driver.set('df2', [2.0, 3.0, 4.0, 0.0])
expected = {'df1': 0.0, 'df2': 2.0, 'df3': 3.0, 'df4': 4.0, 'df5': 0.0}
assert expected == await plc_driver.get('df1-df5')

@@ -160,6 +160,7 @@ async def test_get_xy_error_handling(plc_driver, prefix):
with pytest.raises(ValueError, match=r'address must be in \[001, 816\].'):
await plc_driver.get(f'{prefix}1-{prefix}1001')


@pytest.mark.asyncio
async def test_set_y_error_handling(plc_driver):
"""Ensure errors are handled for invalid set requests of y registers."""

0 comments on commit 365da94

Please sign in to comment.