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

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

    out, _ = capsys.readouterr()
    assert 'published' in out
Example #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('/')
Example #3
0
def send_message():
    message_sent = publish_message()
    return message_sent