def test_del(self):
     c = instrumented.InstrumentedCache("aninteg", 2, 0)
     c["todelete"] = 42
     self.assertEqual(c["todelete"], 42)
     del c["todelete"]
     with self.assertRaises(KeyError):
         c["todelete"]
Example #2
0
 def test_del(self):
     c = instrumented.InstrumentedCache('aninteg', 2, 0)
     c['todelete'] = 42
     self.assertEqual(c['todelete'], 42)
     del c['todelete']
     with self.assertRaises(KeyError):
         c['todelete']
 def test_get_not_exists(self):
     c = instrumented.InstrumentedCache("aninteg", 2, 0)
     with self.assertRaises(KeyError):
         c["akeythatdoesnotexist"]
 def test_get_set(self):
     c = instrumented.InstrumentedCache("aninteg", 2, 0)
     c["lifeuniverseandeverything"] = 42
     self.assertEqual(c["lifeuniverseandeverything"], 42)
Example #5
0
 def test_get_set(self):
     c = instrumented.InstrumentedCache('aninteg', 2, 0)
     c['lifeuniverseandeverything'] = 42
     self.assertEqual(c['lifeuniverseandeverything'], 42)