def test_cache(self): from collector.helpers import cache rc = cache.set('test_key', 'test_value') self.assertNotEqual(0, rc) value = cache.get('test_key', 'default_value') self.assertEqual('test_value', value)
def write_value(self, device, address, set_value): cache.set(self._key(device, address), set_value, 10 * 60) value = self.read_value(device, address) return value