Beispiel #1
0
 def check(request):
     assert request.method == 'POST'
     assert request.url == 'http://endpoint/projects/get/topics/tuple/shards/0'
     crc, compute_crc, pb_str = unwrap_pb_frame(request.body)
     pb_get_record_request = GetRecordsRequest()
     pb_get_record_request.ParseFromString(pb_str)
     assert pb_get_record_request.cursor == '20000000000000000000000000fb0021'
     assert pb_get_record_request.limit == 10
Beispiel #2
0
 def check(request):
     assert request.method == 'POST'
     assert request.url == 'http://endpoint/projects/put/topics/success/shards'
     crc, compute_crc, pb_str = unwrap_pb_frame(request.body)
     pb_put_record_request = PutRecordsRequest()
     pb_put_record_request.ParseFromString(pb_str)
     for pb_record in pb_put_record_request.records:
         assert pb_record.data.data[0].value == data
Beispiel #3
0
        def check(request):
            assert request.method == 'POST'
            assert request.url == 'http://endpoint/projects/put/topics/success/shards'
            crc, compute_crc, pb_str = unwrap_pb_frame(request.body)
            pb_put_record_request = PutRecordsRequest()
            pb_put_record_request.ParseFromString(pb_str)
            assert len(pb_put_record_request.records) == 3
            assert len(pb_put_record_request.records[0].data.data) == 5
            assert pb_put_record_request.records[0].data.data[0].value == b'1'
            assert pb_put_record_request.records[0].data.data[
                1].value == b'yc1'
            assert pb_put_record_request.records[0].data.data[
                2].value == b'10.01'
            assert pb_put_record_request.records[0].data.data[
                3].value == b'true'
            assert pb_put_record_request.records[0].data.data[
                4].value == b'253402271999000000'

            assert len(pb_put_record_request.records[1].data.data) == 5
            assert pb_put_record_request.records[1].data.data[
                0].value == b'-9223372036854775808'
            assert pb_put_record_request.records[1].data.data[
                1].value == b'yc1'
            assert pb_put_record_request.records[1].data.data[
                2].value == b'10.01'
            assert pb_put_record_request.records[1].data.data[
                3].value == b'true'
            assert pb_put_record_request.records[1].data.data[
                4].value == b'-62135798400000000'

            assert len(pb_put_record_request.records[2].data.data) == 5
            assert pb_put_record_request.records[2].data.data[
                0].value == b'9223372036854775807'
            assert pb_put_record_request.records[2].data.data[
                1].value == b'yc1'
            assert pb_put_record_request.records[2].data.data[
                2].value == b'10.01'
            assert pb_put_record_request.records[2].data.data[
                3].value == b'true'
            assert pb_put_record_request.records[2].data.data[
                4].value == b'1455869335000000'