Lines Matching refs:key0
193 key0 = self._box.add(self._template % 0)
196 method(key0)
198 self.assertRaises(KeyError, lambda: self._box[key0])
199 self.assertRaises(KeyError, lambda: method(key0))
215 key0 = self._box.add(self._template % 0)
218 self._box.discard(key0)
220 self.assertRaises(KeyError, lambda: self._box[key0])
221 self._box.discard(key0)
223 self.assertRaises(KeyError, lambda: self._box[key0])
227 key0 = self._box.add(self._template % 0)
228 msg = self._box.get(key0)
242 key0 = self._box.add(self._template % 0)
243 msg = self._box[key0]
247 self._box.discard(key0)
248 self.assertRaises(KeyError, lambda: self._box[key0])
252 key0 = self._box.add(self._template % 0)
254 msg0 = self._box.get_message(key0)
262 key0 = self._box.add(self._template % 0)
264 self.assertEqual(self._box.get_bytes(key0),
270 key0 = self._box.add(self._template % 0)
272 self.assertEqual(self._box.get_string(key0), self._template % 0)
278 key0 = self._box.add(self._template % 0)
280 with self._box.get_file(key0) as file:
357 key0 = self._box.add(self._template % 0)
358 self.assertIn(key0, self._box)
362 self.assertIn(key0, self._box)
364 self._box.remove(key0)
365 self.assertNotIn(key0, self._box)
370 self.assertNotIn(key0, self._box)
387 key0 = self._box.add(self._template % 'original 0')
388 self.assertEqual(self._box.get_string(key0),
393 self._box[key0] = self._template % 'changed 0'
394 self.assertEqual(self._box.get_string(key0),
399 self._box[key0] = _sample_message
400 self._check_sample(self._box[key0])
401 self._box[key1] = self._box[key0]
403 self._box[key0] = self._template % 'original 0'
404 self.assertEqual(self._box.get_string(key0),
426 key0 = self._box.add(self._template % 0)
427 self.assertIn(key0, self._box)
430 self.assertEqual(self._box.pop(key0).get_payload(), '0\n')
431 self.assertNotIn(key0, self._box)
460 key0 = self._box.add(self._template % 'original 0')
463 self._box.update({key0: self._template % 'changed 0',
466 self.assertEqual(self._box.get_string(key0),
473 (key0, self._template % 'original 0')])
475 self.assertEqual(self._box.get_string(key0),
483 key0: self._template % "changed 0"}))
485 self.assertEqual(self._box.get_string(key0),
790 key0 = self._box.add(self._template % 0)
794 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
797 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
800 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
808 key0 = self._box.add(self._template % 0)
821 self.assertEqual(sorted(self._box._toc.keys()), sorted([key0, key1]))
826 key0 = self._box.add(self._template % 0)
827 self.assertEqual(self._box._lookup(key0), os.path.join('new', key0))
828 os.remove(os.path.join(self._path, 'new', key0))
829 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0)})
833 self.assertRaises(KeyError, lambda: self._box._lookup(key0))
1201 key0 = self._box.add(msg0)
1202 self.assertEqual(self._box.get_sequences(), {'foo':[key0]})
1207 {'foo':[key0, key1], 'bar':[key1], 'replied':[key1]})
1209 self._box[key0] = msg0
1212 'flagged':[key0]})
1214 self.assertEqual(self._box.get_sequences(), {'flagged':[key0]})
1219 key0 = self._box.add(msg0)
1220 refmsg0 = self._box.get_message(key0)
1224 key0 = self._box.add(msg0)
1226 self._box.remove(key0)
1239 key0 = self._box.add(msg0)
1244 {'foo':[key0,key1,key2,key3], 'unseen':[key0],
1248 {'foo':[key0,key1,key3], 'unseen':[key0], 'bar':[key3],
1252 key0 = key0
1253 key1 = key0 + 1
1259 key0 = self._box.add(msg1)
1264 self._box.remove(key0)
1297 key0 = self._box.add(msg0)
1304 self._box[key0] = msg0