def test_publish(test_topic, capsys): test_topic.create() publisher.publish_message(test_topic.name, 'hello') out, _ = capsys.readouterr() assert 'published' in out
def publish(): message = request.form['text-id'] if len(message): publisher.publish_message(message) flash('Message Trasmitted') else: flash('Enter a message') return redirect('/')
def send_message(): message_sent = publish_message() return message_sent