Example #1
0
    def test_get_links(self):
        def cached_data(self, key, max_age=None):
            if 'pocket_list' not in CachedData:
                CachedData['pocket_list'] = 12345
                return None
            return CachedData.get(key)
        pocket.Workflow.cached_data = cached_data
        self.assertEquals(pocket.get_links(), 12345)

        CachedData.clear()
        self.assertEquals(pocket.get_links(tries=0), {})
Example #2
0
    def test_get_links(self):
        def cached_data(self, key, max_age=None):
            if 'pocket_list' not in CachedData:
                CachedData['pocket_list'] = 12345
                return None
            return CachedData.get(key)

        pocket.Workflow.cached_data = cached_data
        self.assertEquals(pocket.get_links(), 12345)

        CachedData.clear()
        self.assertEquals(pocket.get_links(tries=0), {})