@@ -80,18 +80,18 @@ def test_it(self):
8080 unindexed_val_pb .integer_value = 10
8181 unindexed_val_pb .exclude_from_indexes = True
8282
83- list_val_pb1 = _new_value_pb (entity_pb , 'baz' )
84- list_pb1 = list_val_pb1 . list_value
83+ array_val_pb1 = _new_value_pb (entity_pb , 'baz' )
84+ array_pb1 = array_val_pb1 . array_value . values
8585
86- unindexed_list_val_pb = list_pb1 .add ()
87- unindexed_list_val_pb .integer_value = 11
88- unindexed_list_val_pb .exclude_from_indexes = True
86+ unindexed_array_val_pb = array_pb1 .add ()
87+ unindexed_array_val_pb .integer_value = 11
88+ unindexed_array_val_pb .exclude_from_indexes = True
8989
90- list_val_pb2 = _new_value_pb (entity_pb , 'qux' )
91- list_pb2 = list_val_pb2 . list_value
90+ array_val_pb2 = _new_value_pb (entity_pb , 'qux' )
91+ array_pb2 = array_val_pb2 . array_value . values
9292
93- indexed_list_val_pb = list_pb2 .add ()
94- indexed_list_val_pb .integer_value = 12
93+ indexed_array_val_pb = array_pb2 .add ()
94+ indexed_array_val_pb .integer_value = 12
9595
9696 entity = self ._callFUT (entity_pb )
9797 self .assertEqual (entity .kind , _KIND )
@@ -119,14 +119,14 @@ def test_mismatched_value_indexed(self):
119119 entity_pb .key .partition_id .project_id = _PROJECT
120120 entity_pb .key .path .add (kind = _KIND , id = _ID )
121121
122- list_val_pb = _new_value_pb (entity_pb , 'baz' )
123- list_pb = list_val_pb . list_value
122+ array_val_pb = _new_value_pb (entity_pb , 'baz' )
123+ array_pb = array_val_pb . array_value . values
124124
125- unindexed_value_pb1 = list_pb .add ()
125+ unindexed_value_pb1 = array_pb .add ()
126126 unindexed_value_pb1 .integer_value = 10
127127 unindexed_value_pb1 .exclude_from_indexes = True
128128
129- unindexed_value_pb2 = list_pb .add ()
129+ unindexed_value_pb2 = array_pb .add ()
130130 unindexed_value_pb2 .integer_value = 11
131131
132132 with self .assertRaises (ValueError ):
@@ -305,14 +305,14 @@ def test_inverts_to_protobuf(self):
305305
306306 # Add a list property.
307307 val_pb4 = _new_value_pb (original_pb , 'list-quux' )
308- list_val1 = val_pb4 .list_value .add ()
309- list_val1 .exclude_from_indexes = True
310- list_val1 .meaning = meaning = 22
311- list_val1 .blob_value = b'\xe2 \x98 \x83 '
312- list_val2 = val_pb4 .list_value .add ()
313- list_val2 .exclude_from_indexes = True
314- list_val2 .meaning = meaning
315- list_val2 .blob_value = b'\xe2 \x98 \x85 '
308+ array_val1 = val_pb4 .array_value . values .add ()
309+ array_val1 .exclude_from_indexes = False
310+ array_val1 .meaning = meaning = 22
311+ array_val1 .blob_value = b'\xe2 \x98 \x83 '
312+ array_val2 = val_pb4 .array_value .add ()
313+ array_val2 .exclude_from_indexes = False
314+ array_val2 .meaning = meaning
315+ array_val2 .blob_value = b'\xe2 \x98 \x85 '
316316
317317 # Convert to the user-space Entity.
318318 entity = entity_from_protobuf (original_pb )
@@ -491,10 +491,10 @@ def test_entity(self):
491491 self .assertEqual (name , 'entity_value' )
492492 self .assertTrue (value is entity )
493493
494- def test_list (self ):
494+ def test_array (self ):
495495 values = ['a' , 0 , 3.14 ]
496496 name , value = self ._callFUT (values )
497- self .assertEqual (name , 'list_value ' )
497+ self .assertEqual (name , 'array_value ' )
498498 self .assertTrue (value is values )
499499
500500 def test_object (self ):
@@ -574,14 +574,14 @@ def test_entity(self):
574574 self .assertTrue (isinstance (entity , Entity ))
575575 self .assertEqual (entity ['foo' ], 'Foo' )
576576
577- def test_list (self ):
577+ def test_array (self ):
578578 from gcloud .datastore ._generated import entity_pb2
579579
580580 pb = entity_pb2 .Value ()
581- list_pb = pb .list_value
582- item_pb = list_pb .add ()
581+ array_pb = pb .array_value . values
582+ item_pb = array_pb .add ()
583583 item_pb .string_value = 'Foo'
584- item_pb = list_pb .add ()
584+ item_pb = array_pb .add ()
585585 item_pb .string_value = 'Bar'
586586 items = self ._callFUT (pb )
587587 self .assertEqual (items , ['Foo' , 'Bar' ])
@@ -723,11 +723,11 @@ def test_entity_w_key(self):
723723 self .assertEqual (list (prop_dict .keys ()), [name ])
724724 self .assertEqual (prop_dict [name ].string_value , value )
725725
726- def test_list (self ):
726+ def test_array (self ):
727727 pb = self ._makePB ()
728728 values = [u'a' , 0 , 3.14 ]
729729 self ._callFUT (pb , values )
730- marshalled = pb .list_value
730+ marshalled = pb .array_value . values
731731 self .assertEqual (len (marshalled ), len (values ))
732732 self .assertEqual (marshalled [0 ].string_value , values [0 ])
733733 self .assertEqual (marshalled [1 ].integer_value , values [1 ])
@@ -836,23 +836,23 @@ def test_single(self):
836836 result = self ._callFUT (value_pb )
837837 self .assertEqual (meaning , result )
838838
839- def test_empty_list_value (self ):
839+ def test_empty_array_value (self ):
840840 from gcloud .datastore ._generated import entity_pb2
841841
842842 value_pb = entity_pb2 .Value ()
843- value_pb .list_value .add ()
844- value_pb .list_value .pop ()
843+ value_pb .array_value . values .add ()
844+ value_pb .array_value . values .pop ()
845845
846846 result = self ._callFUT (value_pb , is_list = True )
847847 self .assertEqual (None , result )
848848
849- def test_list_value (self ):
849+ def test_array_value (self ):
850850 from gcloud .datastore ._generated import entity_pb2
851851
852852 value_pb = entity_pb2 .Value ()
853853 meaning = 9
854- sub_value_pb1 = value_pb .list_value .add ()
855- sub_value_pb2 = value_pb .list_value .add ()
854+ sub_value_pb1 = value_pb .array_value . values .add ()
855+ sub_value_pb2 = value_pb .array_value . values .add ()
856856
857857 sub_value_pb1 .meaning = sub_value_pb2 .meaning = meaning
858858 sub_value_pb1 .string_value = u'hi'
@@ -861,14 +861,14 @@ def test_list_value(self):
861861 result = self ._callFUT (value_pb , is_list = True )
862862 self .assertEqual (meaning , result )
863863
864- def test_list_value_disagreeing (self ):
864+ def test_array_value_disagreeing (self ):
865865 from gcloud .datastore ._generated import entity_pb2
866866
867867 value_pb = entity_pb2 .Value ()
868868 meaning1 = 9
869869 meaning2 = 10
870- sub_value_pb1 = value_pb .list_value .add ()
871- sub_value_pb2 = value_pb .list_value .add ()
870+ sub_value_pb1 = value_pb .array_value . values .add ()
871+ sub_value_pb2 = value_pb .array_value . values .add ()
872872
873873 sub_value_pb1 .meaning = meaning1
874874 sub_value_pb2 .meaning = meaning2
@@ -878,13 +878,13 @@ def test_list_value_disagreeing(self):
878878 with self .assertRaises (ValueError ):
879879 self ._callFUT (value_pb , is_list = True )
880880
881- def test_list_value_partially_unset (self ):
881+ def test_array_value_partially_unset (self ):
882882 from gcloud .datastore ._generated import entity_pb2
883883
884884 value_pb = entity_pb2 .Value ()
885885 meaning1 = 9
886- sub_value_pb1 = value_pb .list_value .add ()
887- sub_value_pb2 = value_pb .list_value .add ()
886+ sub_value_pb1 = value_pb .array_value . values .add ()
887+ sub_value_pb2 = value_pb .array_value . values .add ()
888888
889889 sub_value_pb1 .meaning = meaning1
890890 sub_value_pb1 .string_value = u'hi'
0 commit comments