def test_get_agent_commands_returns_none():
    original_return_value = _developer_mode_responses.get('get_agent_commands')
    _developer_mode_responses['get_agent_commands'] = None

    try:
        app = Application('Python Agent Test (Harvest Loop)')
        app.connect_to_data_collector(None)
        app.process_agent_commands()
    finally:
        _developer_mode_responses['get_agent_commands'] = original_return_value
Beispiel #2
0
def test_get_agent_commands_returns_none():
    MISSING = object()
    original_return_value = DeveloperModeClient.RESPONSES.get(
        "get_agent_commands", MISSING)
    DeveloperModeClient.RESPONSES["get_agent_commands"] = None

    try:
        app = Application("Python Agent Test (Harvest Loop)")
        app.connect_to_data_collector(None)
        app.process_agent_commands()
    finally:
        if original_return_value is MISSING:
            DeveloperModeClient.RESPONSES.pop("get_agent_commands")
        else:
            DeveloperModeClient.RESPONSES[
                "get_agent_commands"] = original_return_value
Beispiel #3
0
def test_get_agent_commands_raises():
    app = Application("Python Agent Test (Harvest Loop)")
    app.connect_to_data_collector(None)
    with pytest.raises(RetryDataForRequest):
        app.process_agent_commands()