Beispiel #1
0
def test_subscribe_with_avro_schema(avro_schema, avro_topic, avro_subscription,
                                    capsys):
    schema.publish_avro_records(PROJECT_ID, AVRO_TOPIC_ID, AVSC_FILE)

    schema.subscribe_with_avro_schema(PROJECT_ID, AVRO_SUBSCRIPTION_ID,
                                      AVSC_FILE, 9)
    out, _ = capsys.readouterr()
    assert "Received a binary-encoded message:" in out
Beispiel #2
0
def test_publish_avro_records(avro_schema, avro_topic, capsys):
    schema.publish_avro_records(PROJECT_ID, AVRO_TOPIC_ID, AVSC_FILE)
    out, _ = capsys.readouterr()
    assert "Preparing a binary-encoded message" in out
    assert "Published message ID" in out