

@timed(2)
def test_message_flooding_is_ok(self):
    "Test if multiple messages are send in one frame, it's ok."
    m = Main()
    m.tcp_connect()
    connect_frame = m.build_frame('CONNECT', [], '')
    subscrible_frame_1 = m.build_frame('SUBSCRIBE', [('destination', config.TEST_TOPICS[0]), ('x-ebu-nofastreply', 'yes')], '')
    m.socket.send((connect_frame + subscrible_frame_1))
    msg = str(uuid.uuid4())
    message_id = str(uuid.uuid4())
    m2 = Main()
    m2.tcp_connect()
    m2.send_connect([('login', '1.test'), ('passcode', 'test')])
    m2.get_frame()
    m2.send_frame('SEND', [('destination', config.TEST_TOPICS[0]), ('message-id', message_id)], msg)
    (result, headers, body) = m.get_frame()
    eq_(result, 'CONNECTED')
    (result, headers, body) = m.get_frame()
    eq_(result, 'MESSAGE')
    eq_(body, msg)
    eq_(get_header_value(headers, 'destination'), config.TEST_TOPICS[0])
    eq_(get_header_value(headers, 'message-id'), message_id)

dataset/ETHPy150Open ebu/radiodns-plugit/RadioVisServer/tests.py MainTests.test_message_flooding_is_ok/original