Skip to content

Commit

Permalink
Merge pull request #511 from tseaver/500-un_duplicate_helpers_tests
Browse files Browse the repository at this point in the history
Remove now-redundant testcase.
  • Loading branch information
tseaver committed Jan 8, 2015
2 parents 549c175 + 0e22a7b commit 6bde37d
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions gcloud/datastore/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,7 @@ def _callFUT(self, val):
from gcloud.datastore.helpers import entity_from_protobuf
return entity_from_protobuf(val)

def test_wo_dataset_id(self):
from gcloud.datastore import datastore_v1_pb2 as datastore_pb

_DATASET_ID = 'DATASET'
_KIND = 'KIND'
_ID = 1234
entity_pb = datastore_pb.Entity()
entity_pb.key.partition_id.dataset_id = _DATASET_ID
entity_pb.key.path_element.add(kind=_KIND, id=_ID)
prop_pb = entity_pb.property.add()
prop_pb.name = 'foo'
prop_pb.value.string_value = 'Foo'
entity = self._callFUT(entity_pb)
self.assertEqual(entity.kind, _KIND)
self.assertEqual(entity['foo'], 'Foo')
key = entity.key
self.assertEqual(key.dataset_id, _DATASET_ID)
self.assertEqual(key.namespace, None)
self.assertEqual(key.kind, _KIND)
self.assertEqual(key.id, _ID)

def test_w_dataset_id(self):
def test_it(self):
from gcloud.datastore import datastore_v1_pb2 as datastore_pb

_DATASET_ID = 'DATASET'
Expand Down Expand Up @@ -96,7 +75,7 @@ def _makePB(self, dataset_id=None, namespace=None, path=()):
added.name = elem['name']
return pb

def test_w_dataset_id_in_pb(self):
def test_wo_namespace_in_pb(self):
_DATASET = 'DATASET'
pb = self._makePB(path=[{'kind': 'KIND'}], dataset_id=_DATASET)
key = self._callFUT(pb)
Expand All @@ -112,7 +91,7 @@ def test_w_namespace_in_pb(self):
self.assertEqual(key.dataset_id, _DATASET)
self.assertEqual(key.namespace, _NAMESPACE)

def test_w_path_in_pb(self):
def test_w_nested_path_in_pb(self):
_PATH = [
{'kind': 'PARENT', 'name': 'NAME'},
{'kind': 'CHILD', 'id': 1234},
Expand Down

0 comments on commit 6bde37d

Please sign in to comment.