<commit_before>*** Settings ***
Library     my_handler.py
Resource        ../Protocols.txt
Suite Setup     Setup protocol, TCP server, and client
Test teardown    Teardown rammbock and increment port numbers
#Default tags    regression

*** Test cases ***
Register an auto reply
    Define sample template
    Set client handler  handle_sample
    Server sends sample message
    Server sends another message
    Client receives another message
    Handler should have been called with sample message<commit_msg>Test Case for Asynchronous message handling<commit_after>*** Settings ***
Library     my_handler.py
Resource        ../Protocols.txt
Suite Setup     Setup protocol, TCP server, and client
Test teardown    Teardown rammbock and increment port numbers
#Default tags    regression

*** Test cases ***
Register an auto reply
    Define Templates
    Load Template   sample
    Set client handler  my_handler.handle_sample
    Server sends sample message
    Server sends another message
    Client receives another message
    Handler should have been called with sample message

*** Keywords ***
Define Templates
    Define sample template
    Define another template
Define sample template
    New Message     sample  Example     header:messageType:0x0042
    u16     foo     1
    Save Template   sample
Define another template
    New Message     sample  Example     header:messageType:0x00ab
    u16     foo     100
    u16     eoo      500
    Save Template   another
Server sends sample message
    Load Template   sample
    Server sends message
Server sends another message
    Load Template   another
    Server sends message
Client receives another message
    Load Template   another
    Client receives message   header_filter=messageType
Handler should have been called with sample message
    ${rcvd msgs}   Get rcvd msg
    Length should be   ${rcvd_msgs}     1
    ${msg}=    Set variable   ${rcvd msgs[0]}
    Should be equal   ${msg._header.messageType.hex}     0x0042
{'fraction_non_alphanumeric': 0.039598997493734335, 'fraction_numerical': 0.014035087719298246, 'mean_word_length': 3.0404858299595143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '924675', 'n_tokens_mistral': 496, 'n_tokens_neox': 479, 'n_words': 221}