Skip to content

Commit

Permalink
Moves and renames location_prefix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
egalpin authored and dhermes committed Dec 20, 2017
1 parent aac35ad commit 05f9cec
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions datastore/tests/unit/test_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,15 @@ def test_to_legacy_urlsafe_strip_padding(self):
# Make sure it started with base64 padding.
self.assertNotEqual(len(self._URLSAFE_EXAMPLE2) % 4, 0)

def test_to_legacy_urlsafe_with_location_prefix(self):
key = self._make_one(
*self._URLSAFE_FLAT_PATH1,
project=self._URLSAFE_APP3,
namespace=self._URLSAFE_NAMESPACE1)
# NOTE: ``key.project`` is somewhat "invalid" but that is OK.
urlsafe = key.to_legacy_urlsafe(self._URLSAFE_LOCATION_PREFIX)
self.assertEqual(urlsafe, self._URLSAFE_EXAMPLE3)

def test_from_legacy_urlsafe(self):
klass = self._get_target_class()
key = klass.from_legacy_urlsafe(self._URLSAFE_EXAMPLE1)
Expand All @@ -435,15 +444,6 @@ def test_from_legacy_urlsafe_needs_padding(self):
self.assertIsNone(key.namespace)
self.assertEqual(key.flat_path, self._URLSAFE_FLAT_PATH2)

def test_from_legacy_urlsafe_with_location_prefix(self):
key = self._make_one(
*self._URLSAFE_FLAT_PATH1,
project=self._URLSAFE_APP3,
namespace=self._URLSAFE_NAMESPACE1)
# NOTE: ``key.project`` is somewhat "invalid" but that is OK.
urlsafe = key.to_legacy_urlsafe(self._URLSAFE_LOCATION_PREFIX)
self.assertEqual(urlsafe, self._URLSAFE_EXAMPLE3)

def test_is_partial_no_name_or_id(self):
key = self._make_one('KIND', project=self._DEFAULT_PROJECT)
self.assertTrue(key.is_partial)
Expand Down

0 comments on commit 05f9cec

Please sign in to comment.