@@ -65,6 +65,7 @@ def test__request_w_200(self):
6565 'method' : 'POST' ,
6666 'headers' : {'Content-Type' : 'application/x-protobuf' ,
6767 'Content-Length' : '4' ,
68+ 'User-Agent' : conn .USER_AGENT ,
6869 },
6970 'body' : DATA ,
7071 })
@@ -115,6 +116,7 @@ def FromString(cls, pb):
115116 'method' : 'POST' ,
116117 'headers' : {'Content-Type' : 'application/x-protobuf' ,
117118 'Content-Length' : '5' ,
119+ 'User-Agent' : conn .USER_AGENT ,
118120 },
119121 'body' : b'REQPB' ,
120122 })
@@ -218,6 +220,7 @@ def test_begin_transaction_default_serialize(self):
218220 self .assertEqual (cw ['headers' ],
219221 {'Content-Type' : 'application/x-protobuf' ,
220222 'Content-Length' : '2' ,
223+ 'User-Agent' : conn .USER_AGENT ,
221224 })
222225 rq_class = datastore_pb .BeginTransactionRequest
223226 request = rq_class ()
@@ -248,6 +251,7 @@ def test_begin_transaction_explicit_serialize(self):
248251 self .assertEqual (cw ['headers' ],
249252 {'Content-Type' : 'application/x-protobuf' ,
250253 'Content-Length' : '2' ,
254+ 'User-Agent' : conn .USER_AGENT ,
251255 })
252256 rq_class = datastore_pb .BeginTransactionRequest
253257 request = rq_class ()
@@ -299,6 +303,7 @@ def id(self):
299303 self .assertEqual (cw ['headers' ],
300304 {'Content-Type' : 'application/x-protobuf' ,
301305 'Content-Length' : '6' ,
306+ 'User-Agent' : conn .USER_AGENT ,
302307 })
303308 rq_class = datastore_pb .RollbackRequest
304309 request = rq_class ()
@@ -333,6 +338,7 @@ def test_run_query_wo_namespace_empty_result(self):
333338 self .assertEqual (cw ['headers' ],
334339 {'Content-Type' : 'application/x-protobuf' ,
335340 'Content-Length' : '14' ,
341+ 'User-Agent' : conn .USER_AGENT ,
336342 })
337343 rq_class = datastore_pb .RunQueryRequest
338344 request = rq_class ()
@@ -369,6 +375,7 @@ def test_run_query_w_namespace_nonempty_result(self):
369375 self .assertEqual (cw ['headers' ],
370376 {'Content-Type' : 'application/x-protobuf' ,
371377 'Content-Length' : '16' ,
378+ 'User-Agent' : conn .USER_AGENT ,
372379 })
373380 rq_class = datastore_pb .RunQueryRequest
374381 request = rq_class ()
@@ -401,6 +408,7 @@ def test_lookup_single_key_empty_response(self):
401408 self .assertEqual (cw ['headers' ],
402409 {'Content-Type' : 'application/x-protobuf' ,
403410 'Content-Length' : '26' ,
411+ 'User-Agent' : conn .USER_AGENT ,
404412 })
405413 rq_class = datastore_pb .LookupRequest
406414 request = rq_class ()
@@ -439,6 +447,7 @@ def test_lookup_single_key_nonempty_response(self):
439447 self .assertEqual (cw ['headers' ],
440448 {'Content-Type' : 'application/x-protobuf' ,
441449 'Content-Length' : '26' ,
450+ 'User-Agent' : conn .USER_AGENT ,
442451 })
443452 rq_class = datastore_pb .LookupRequest
444453 request = rq_class ()
@@ -474,6 +483,7 @@ def test_lookup_multiple_keys_empty_response(self):
474483 self .assertEqual (cw ['headers' ],
475484 {'Content-Type' : 'application/x-protobuf' ,
476485 'Content-Length' : '52' ,
486+ 'User-Agent' : conn .USER_AGENT ,
477487 })
478488 rq_class = datastore_pb .LookupRequest
479489 request = rq_class ()
@@ -516,6 +526,7 @@ def test_commit_wo_transaction(self):
516526 self .assertEqual (cw ['headers' ],
517527 {'Content-Type' : 'application/x-protobuf' ,
518528 'Content-Length' : '47' ,
529+ 'User-Agent' : conn .USER_AGENT ,
519530 })
520531 rq_class = datastore_pb .CommitRequest
521532 request = rq_class ()
@@ -561,6 +572,7 @@ def id(self):
561572 self .assertEqual (cw ['headers' ],
562573 {'Content-Type' : 'application/x-protobuf' ,
563574 'Content-Length' : '53' ,
575+ 'User-Agent' : conn .USER_AGENT ,
564576 })
565577 rq_class = datastore_pb .CommitRequest
566578 request = rq_class ()
@@ -595,6 +607,7 @@ def test_save_entity_wo_transaction_w_upsert(self):
595607 self .assertEqual (cw ['headers' ],
596608 {'Content-Type' : 'application/x-protobuf' ,
597609 'Content-Length' : '47' ,
610+ 'User-Agent' : conn .USER_AGENT ,
598611 })
599612 rq_class = datastore_pb .CommitRequest
600613 request = rq_class ()
@@ -645,6 +658,7 @@ def test_save_entity_wo_transaction_w_auto_id(self):
645658 self .assertEqual (cw ['headers' ],
646659 {'Content-Type' : 'application/x-protobuf' ,
647660 'Content-Length' : '44' ,
661+ 'User-Agent' : conn .USER_AGENT ,
648662 })
649663 rq_class = datastore_pb .CommitRequest
650664 request = rq_class ()
@@ -720,6 +734,7 @@ def test_delete_entities_wo_transaction(self):
720734 self .assertEqual (cw ['headers' ],
721735 {'Content-Type' : 'application/x-protobuf' ,
722736 'Content-Length' : '30' ,
737+ 'User-Agent' : conn .USER_AGENT ,
723738 })
724739 rq_class = datastore_pb .CommitRequest
725740 request = rq_class ()
@@ -791,6 +806,7 @@ def test_delete_entity_wo_transaction(self):
791806 self .assertEqual (cw ['headers' ],
792807 {'Content-Type' : 'application/x-protobuf' ,
793808 'Content-Length' : '30' ,
809+ 'User-Agent' : conn .USER_AGENT ,
794810 })
795811 rq_class = datastore_pb .CommitRequest
796812 request = rq_class ()
0 commit comments