Esempio n. 1
0
    def setUp(self):
        """Init the api url and the token identifier."""
        self.api_url = "http://lesbonneschoses.prismic.io/api"
        self.token = "MC5VZ2phOGRfbXFaOEl2UEpj.dO-_ve-_ve-_ve-_vSFRBzXvv71V77-977-9BO-_vVbvv71k77-9Cu-_ve-_vQTvv71177-9eQpcUE3vv70"
        self.fixture_api = json.loads(fixture_api)
        self.fixture_search = json.loads(fixture_search)
        self.fixture_structured_lists = json.loads(fixture_structured_lists)
        self.fixture_empty_paragraph = json.loads(fixture_empty_paragraph)
        self.fixture_block_labels = json.loads(fixture_block_labels)
        self.fixture_store_geopoint = json.loads(fixture_store_geopoint)
        self.fixture_groups = json.loads(fixture_groups)
        self.fixture_image_links = json.loads(fixture_image_links)
        self.fixture_spans_labels = json.loads(fixture_spans_labels)
        self.fixture_custom_html = json.loads(fixture_custom_html)

        self.api = prismic.Api(self.fixture_api, self.token,
                               ShelveCache("prismictest"), None)
Esempio n. 2
0
class TestCache(unittest.TestCase):
    def setUp(self):
        self.cache = ShelveCache("cachetest")

    def test_set_get(self):
        self.cache.set("foo", "bar", 3600)
        self.assertEqual(self.cache.get("foo"), "bar")

    def test_expiration(self):
        self.cache.set("toto", "tata", 2)
        time.sleep(3)
        self.assertIsNone(self.cache.get("toto"))
Esempio n. 3
0
    def setUp(self):
        """Init the api url and the token identifier."""
        self.api_url = "http://micro.prismic.io/api"
        self.token = "MC5VcXBHWHdFQUFONDZrbWp4.77-9cDx6C3lgJu-_vXZafO-_vXPvv73vv73vv70777-9Ju-_ve-_vSLvv73vv73vv73vv70O77-977-9Me-_vQ"
        self.fixture_api = json.loads(fixture_api)
        self.fixture_search = json.loads(fixture_search)
        self.fixture_structured_lists = json.loads(fixture_structured_lists)
        self.fixture_empty_paragraph = json.loads(fixture_empty_paragraph)
        self.fixture_block_labels = json.loads(fixture_block_labels)
        self.fixture_store_geopoint = json.loads(fixture_store_geopoint)
        self.fixture_groups = json.loads(fixture_groups)
        self.fixture_image_links = json.loads(fixture_image_links)
        self.fixture_spans_labels = json.loads(fixture_spans_labels)
        self.fixture_custom_html = json.loads(fixture_custom_html)
        self.fixture_slices = json.loads(fixture_slices)
        self.fixture_composite_slices = json.loads(fixture_composite_slices)

        self.api = prismic.Api(self.fixture_api, self.token, ShelveCache("prismictest"), None)
Esempio n. 4
0
class TestCache(unittest.TestCase):

    def setUp(self):
        self.cache = ShelveCache("cachetest")

    def test_set_get(self):
        self.cache.set("foo", "bar", 3600)
        self.assertEqual(self.cache.get("foo"), "bar")

    def test_expiration(self):
        self.cache.set("toto", "tata", 2)
        time.sleep(3)
        self.assertIsNone(self.cache.get("toto"))
Esempio n. 5
0
 def setUp(self):
     self.cache = ShelveCache("cachetest")
Esempio n. 6
0
 def setUp(self):
     self.cache = ShelveCache("cachetest")