Skip to content

Commit

Permalink
Chixen bonez.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Jan 7, 2015
1 parent a87a143 commit 90829f5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions gcloud/datastore/test_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def test_ctor_parent(self):
]
parent_key = self._makeOne(_PARENT_KIND, _PARENT_ID,
dataset_id=_PARENT_DATASET,
namespace=_PARENT_NAMESPACE,
)
namespace=_PARENT_NAMESPACE)
key = self._makeOne(_CHILD_KIND, _CHILD_ID, parent=parent_key)
self.assertEqual(key.dataset_id, parent_key.dataset_id)
self.assertEqual(key.namespace, parent_key.namespace)
Expand All @@ -97,7 +96,7 @@ def test_ctor_parent_bad_type(self):

def test_ctor_parent_bad_namespace(self):
parent_key = self._makeOne('KIND', 1234, namespace='FOO',
dataset_id=self._DEFAULT_DATASET)
dataset_id=self._DEFAULT_DATASET)
with self.assertRaises(ValueError):
self._makeOne('KIND2', 1234, namespace='BAR', parent=parent_key,
dataset_id=self._DEFAULT_DATASET)
Expand Down Expand Up @@ -128,17 +127,16 @@ def test_ctor_explicit(self):
self.assertEqual(key.path, _PATH)

def test_ctor_bad_kind(self):
self.assertRaises(ValueError,
self._makeOne, object(), dataset_id=self._DEFAULT_DATASET)
self.assertRaises(ValueError, self._makeOne, object(),
dataset_id=self._DEFAULT_DATASET)

def test_ctor_bad_id_or_name(self):
self.assertRaises(ValueError, self._makeOne, 'KIND', object(),
dataset_id=self._DEFAULT_DATASET)
dataset_id=self._DEFAULT_DATASET)
self.assertRaises(ValueError, self._makeOne, 'KIND', None,
dataset_id=self._DEFAULT_DATASET)
self.assertRaises(ValueError,
self._makeOne, 'KIND', 10, 'KIND2', None,
dataset_id=self._DEFAULT_DATASET)
dataset_id=self._DEFAULT_DATASET)
self.assertRaises(ValueError, self._makeOne, 'KIND', 10, 'KIND2', None,
dataset_id=self._DEFAULT_DATASET)

def test__clone(self):
_DATASET = 'DATASET-ALT'
Expand Down

0 comments on commit 90829f5

Please sign in to comment.