Skip to content

Commit d46ed28

Browse files
committed
Squash lint errors.
1 parent 8a6127e commit d46ed28

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

gcloud/datastore/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Entity(dict):
6565
6666
:type key: :class:`gcloud.datastore.key.Key`
6767
:param key: Optional key to be set on entity. Required for
68-
:fund:`gcloud.datastore.put()`
68+
:func:`gcloud.datastore.put()`
6969
7070
:type exclude_from_indexes: tuple of string
7171
:param exclude_from_indexes: Names of fields whose values are not to be

gcloud/datastore/test_api.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,29 @@ def _callFUT(self, keys):
9696
from gcloud.datastore.api import _get_dataset_id_from_keys
9797
return _get_dataset_id_from_keys(keys)
9898

99+
def _make_key(self, dataset_id):
100+
101+
class _Key(object):
102+
def __init__(self, dataset_id):
103+
self.dataset_id = dataset_id
104+
105+
return _Key(dataset_id)
106+
99107
def test_empty(self):
100108
self.assertRaises(IndexError, self._callFUT, [])
101109

102110
def test_w_None(self):
103111
self.assertRaises(ValueError, self._callFUT, [None])
104112

105113
def test_w_mismatch(self):
106-
foo = _Key('foo')
107-
bar = _Key('bar')
108-
self.assertRaises(ValueError, self._callFUT, [foo, bar])
114+
key1 = self._make_key('foo')
115+
key2 = self._make_key('bar')
116+
self.assertRaises(ValueError, self._callFUT, [key1, key2])
109117

110118
def test_w_match(self):
111-
foo1 = _Key('foo')
112-
foo2 = _Key('foo')
113-
self.assertEqual(self._callFUT([foo1, foo2]), 'foo')
119+
key1 = self._make_key('foo')
120+
key2 = self._make_key('foo')
121+
self.assertEqual(self._callFUT([key1, key2]), 'foo')
114122

115123

116124
class Test_get_function(unittest2.TestCase):
@@ -575,8 +583,3 @@ def test_with_already_completed_key(self):
575583
COMPLETE_KEY = Key('KIND', 1234)
576584
self.assertRaises(ValueError, self._callFUT,
577585
COMPLETE_KEY, 2)
578-
579-
580-
class _Key(object):
581-
def __init__(self, dataset_id):
582-
self.dataset_id = dataset_id

0 commit comments

Comments
 (0)