Esempio n. 1
0
 def test_get_collection_id_from_cache_key_for_strings(self):
     """
     Test get_collection_id_from_cache_key for strings
     """
     element = ('some/testkey', 'my_config_value')
     self.assertEqual(
         element,
         collection.get_collection_id_from_cache_key(
             collection.get_single_element_cache_key(*element)))
Esempio n. 2
0
 def test_get_collection_id_from_cache_key_for_strings(self):
     """
     Test get_collection_id_from_cache_key for strings
     """
     element = ('some/testkey', 'my_config_value')
     self.assertEqual(
         element,
         collection.get_collection_id_from_cache_key(
             collection.get_single_element_cache_key(*element)))
Esempio n. 3
0
 def test_get_collection_id_from_cache_key(self):
     """
     Test that get_collection_id_from_cache_key works together with
     get_single_element_cache_key.
     """
     element = ('some/testkey', 42)
     self.assertEqual(
         element,
         collection.get_collection_id_from_cache_key(
             collection.get_single_element_cache_key(*element)))
Esempio n. 4
0
    def test_get_single_element_cache_key_prefix(self):
        """
        Tests that the cache prefix is realy a prefix.
        """
        element = ('some/testkey', 42)

        cache_key = collection.get_single_element_cache_key(*element)
        prefix = collection.get_single_element_cache_key_prefix(element[0])

        self.assertTrue(cache_key.startswith(prefix))
Esempio n. 5
0
 def test_get_collection_id_from_cache_key(self):
     """
     Test that get_collection_id_from_cache_key works together with
     get_single_element_cache_key.
     """
     element = ('some/testkey', 42)
     self.assertEqual(
         element,
         collection.get_collection_id_from_cache_key(
             collection.get_single_element_cache_key(*element)))
Esempio n. 6
0
    def test_get_single_element_cache_key_prefix(self):
        """
        Tests that the cache prefix is realy a prefix.
        """
        element = ('some/testkey', 42)

        cache_key = collection.get_single_element_cache_key(*element)
        prefix = collection.get_single_element_cache_key_prefix(element[0])

        self.assertTrue(cache_key.startswith(prefix))