SIENTIAPDE-1314
Refactor OPC Write Test to Separate Output Data and Metrics - Updated the test for the OPC write operation to separately assert output data and OPC metrics for improved clarity and accuracy in testing. - Changed the variable names to reflect the new structure of the returned values from the write operation.
This commit is contained in:
@@ -276,13 +276,11 @@ async def test_write_opc_data_success(mock_dataframe, opc):
|
||||
opc.manage_output_tags = AsyncMock(return_value=(True, {'tag1': 0.1, 'tag2': 0.2}))
|
||||
|
||||
opc.process_confidence = MagicMock(return_value={'data': 'data'})
|
||||
output = await opc.write_opc_data(input_data)
|
||||
output_data, opc_metrics = await opc.write_opc_data(input_data)
|
||||
|
||||
# Assert
|
||||
assert output == {
|
||||
'data': {'data': 'data'},
|
||||
'metrics': {'server1': {'tag1': 0.1, 'tag2': 0.2}},
|
||||
}
|
||||
assert output_data == {'data': 'data'}
|
||||
assert opc_metrics == {'server1': {'tag1': 0.1, 'tag2': 0.2}}
|
||||
opc.manage_output_tags.assert_called_once_with(
|
||||
'server1',
|
||||
input_data['opc_output_config']['server1'],
|
||||
|
||||
Reference in New Issue
Block a user