def test_refresh_status(mock_send_message_json,mock_timer): """Test Loop instance methode.""" loop = LoopInstance(template="template", name="test", details={}) mock_send_message_json.return_value = LOOP_DETAILS loop.refresh_status() mock_send_message_json.assert_called_once_with('GET', 'Get loop status', (f"{loop.base_url()}/loop/getstatus/LOOP_test"), cert=loop.cert) assert loop.details == LOOP_DETAILS
def test_refresh_status_error(mock_send_message_json): """Test Loop instance methode.""" loop = LoopInstance(template="template", name="test", details={}) mock_send_message_json.return_value = {} with pytest.raises(ValueError): loop.refresh_status() mock_send_message_json.assert_called_once_with('GET', 'Get loop status', (f"{loop.base_url()}/loop/getstatus/LOOP_test"), cert=loop.cert) assert loop.details == {}