File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,26 @@ def test_get_entity_path(self):
151151 self .assertEqual (list (result ), ['foo' ])
152152 self .assertEqual (result ['foo' ], 'Foo' )
153153
154+ def test_get_entity_odd_nonetype (self ):
155+ from gcloud .datastore .connection import datastore_pb
156+ DATASET_ID = 'DATASET'
157+ KIND = 'Kind'
158+ ID = 1234
159+ entity_pb = datastore_pb .Entity ()
160+ entity_pb .key .partition_id .dataset_id = DATASET_ID
161+ path_element = entity_pb .key .path_element .add ()
162+ path_element .kind = KIND
163+ path_element .id = ID
164+ prop = entity_pb .property .add ()
165+ prop .name = 'foo'
166+ prop .value .string_value = 'Foo'
167+ connection = _Connection (entity_pb )
168+ dataset = self ._makeOne (DATASET_ID , connection )
169+ with self .assertRaises (ValueError ):
170+ dataset .get_entity ([KIND ])
171+ with self .assertRaises (TypeError ):
172+ dataset .get_entity (None )
173+
154174
155175class _Connection (object ):
156176 _called_with = None
You can’t perform that action at this time.
0 commit comments