示例#1
0
def test_subscribe_with_proto_schema(proto_schema, proto_topic,
                                     proto_subscription, capsys):
    schema.publish_proto_messages(PROJECT_ID, PROTO_TOPIC_ID)

    schema.subscribe_with_proto_schema(PROJECT_ID, PROTO_SUBSCRIPTION_ID, 9)
    out, _ = capsys.readouterr()
    assert "Received a binary-encoded message" in out
示例#2
0
def test_publish_proto_records(proto_topic, capsys):
    schema.publish_proto_messages(PROJECT_ID, PROTO_TOPIC_ID)
    out, _ = capsys.readouterr()
    assert "Preparing a binary-encoded message" in out
    assert "Published message ID" in out