def test_publish(test_topic, capsys):
    test_topic.create()

    publisher.publish_message(test_topic.name, 'hello')

    out, _ = capsys.readouterr()
    assert 'published' in out
Exemplo n.º 2
0
def publish():
    message = request.form['text-id']
    if len(message):
        publisher.publish_message(message)
        flash('Message Trasmitted')
    else:
        flash('Enter a message')
    return redirect('/')
Exemplo n.º 3
0
def send_message():
    message_sent = publish_message()
    return message_sent