def METHOD_NAME(remove_database, restart_wazuh_daemon, test_case, create_groups):
    '''
    description: Check that every input message using the 'set_agent_groups' command in wazuh-db socket generates
                 the proper output to wazuh-db socket. To do this, it performs a query to the socket with a command
                 taken from the list of test_cases's 'input' field, and compare the result with the test_case's
                 'output' and 'expected_group' fields.
    wazuh_min_version: 4.4.0
    parameters:
        - remove_database:
            type: fixture
            brief: Delete databases.
        - restart_wazuh:
            type: fixture
            brief: Reset the 'ossec.log' file and restart Wazuh.
        - test_case:
            type: fixture
            brief: List of test_case stages (dicts with input, output and agent_id and expected_groups keys).
        - create_groups:
            type: fixture:
            brief: Create required groups.
    assertions:
        - Verify that the socket response matches the expected output.
        - Verify that the agent has the expected_group assigned.
    input_description:
        - Test cases are defined in the set_agent_groups.yaml file. This file contains the command to insert the agents
          groups, with different modes and combinations, as well as the expected outputs and results.
    expected_output:
        - f"Assertion Error - expected {output}, but got {response}"
        - 'Unable to add agent'
        - 'did not recieve expected groups in Agent.'
    tags:
        - wazuh_db
        - wdb_socket
    '''
    output = test_case['output']
    agent_id = test_case['agent_id']
    # Insert test Agent
    response = insert_agent_in_db(id=agent_id, connection_status='disconnected', registration_time=str(time.time()))
    # Apply preconditions
    if 'pre_input' in test_case:
        query_wdb(test_case['pre_input'])
    # Add tested group
    response = query_wdb(test_case["input"])
    # validate output
    assert response == output, f"Assertion Error - expected {output}, but got {response}"
    # Check warnings
    if 'expected_warning' in test_case:
        callback = test_case['expected_warning']
        evm.check_event(callback=callback, file_to_monitor=fw.LOG_FILE_PATH, timeout=20).result()
    # get agent data and validate agent's groups
    response = query_wdb(f'global get-agent-info {agent_id}')
    assert test_case['expected_group_sync_status'] == response[0]['group_sync_status']
    if test_case["expected_group"] == 'None':
        assert 'group' not in response[0], "Agent has groups data and it was expecting no group data"
    else:
        assert test_case["expected_group"] == response[0]['group'], "Did not receive the expected groups in the agent."