Lines Matching refs:key0
101 key0 = self._box.add(self._template % 0)
104 method(key0)
107 self.assertRaises(KeyError, lambda: self._box[key0])
108 self.assertRaises(KeyError, lambda: method(key0))
125 key0 = self._box.add(self._template % 0)
128 self._box.discard(key0)
130 self.assertRaises(KeyError, lambda: self._box[key0])
131 self._box.discard(key0)
133 self.assertRaises(KeyError, lambda: self._box[key0])
137 key0 = self._box.add(self._template % 0)
138 msg = self._box.get(key0)
153 key0 = self._box.add(self._template % 0)
154 msg = self._box[key0]
158 self._box.discard(key0)
159 self.assertRaises(KeyError, lambda: self._box[key0])
163 key0 = self._box.add(self._template % 0)
165 msg0 = self._box.get_message(key0)
173 key0 = self._box.add(self._template % 0)
175 self.assertEqual(self._box.get_string(key0), self._template % 0)
180 key0 = self._box.add(self._template % 0)
182 msg0 = self._box.get_file(key0)
267 key0 = self._box.add(self._template % 0)
268 self.assertTrue(method(key0))
272 self.assertTrue(method(key0))
274 self._box.remove(key0)
275 self.assertFalse(method(key0))
280 self.assertFalse(method(key0))
297 key0 = self._box.add(self._template % 'original 0')
298 self.assertEqual(self._box.get_string(key0),
303 self._box[key0] = self._template % 'changed 0'
304 self.assertEqual(self._box.get_string(key0),
309 self._box[key0] = _sample_message
310 self._check_sample(self._box[key0])
311 self._box[key1] = self._box[key0]
313 self._box[key0] = self._template % 'original 0'
314 self.assertEqual(self._box.get_string(key0),
336 key0 = self._box.add(self._template % 0)
337 self.assertIn(key0, self._box)
340 self.assertEqual(self._box.pop(key0).get_payload(), '0\n')
341 self.assertNotIn(key0, self._box)
370 key0 = self._box.add(self._template % 'original 0')
373 self._box.update({key0: self._template % 'changed 0',
376 self.assertEqual(self._box.get_string(key0),
383 (key0, self._template % 'original 0')])
385 self.assertEqual(self._box.get_string(key0),
393 key0: self._template % "changed 0"}))
395 self.assertEqual(self._box.get_string(key0),
698 key0 = self._box.add(self._template % 0)
702 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
705 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
708 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
716 key0 = self._box.add(self._template % 0)
729 self.assertEqual(sorted(self._box._toc.keys()), sorted([key0, key1]))
734 key0 = self._box.add(self._template % 0)
735 self.assertEqual(self._box._lookup(key0), os.path.join('new', key0))
736 os.remove(os.path.join(self._path, 'new', key0))
737 self.assertEqual(self._box._toc, {key0: os.path.join('new', key0)})
741 self.assertRaises(KeyError, lambda: self._box._lookup(key0))
1096 key0 = self._box.add(msg0)
1097 self.assertEqual(self._box.get_sequences(), {'foo':[key0]})
1102 {'foo':[key0, key1], 'bar':[key1], 'replied':[key1]})
1104 self._box[key0] = msg0
1107 'flagged':[key0]})
1109 self.assertEqual(self._box.get_sequences(), {'flagged':[key0]})
1114 key0 = self._box.add(msg0)
1115 refmsg0 = self._box.get_message(key0)
1119 key0 = self._box.add(msg0)
1121 self._box.remove(key0)
1134 key0 = self._box.add(msg0)
1139 {'foo':[key0,key1,key2,key3], 'unseen':[key0],
1143 {'foo':[key0,key1,key3], 'unseen':[key0], 'bar':[key3],
1147 key0 = key0
1148 key1 = key0 + 1
1154 key0 = self._box.add(msg1)
1159 self._box.remove(key0)
1187 key0 = self._box.add(msg0)
1194 self._box[key0] = msg0