Exemple #1
0
 def test_base(self):
     msgid1 = construct_message_id('testapp', 21)
     msgid2 = construct_message_id('testapp', 21)
     self.assertNotEqual(msgid1, msgid2)
     self.assertNotIn('&', msgid1)
     self.assertNotIn('=', msgid1)
     self.assertNotIn('/', msgid1)
     self.assertNotIn('+', msgid1)
     values = parse_message_id(msgid1, 'testapp')
     self.assertTrue(values)
     # parse_message_id should work with or without surrounding <>
     self.assertEqual(values, parse_message_id(msgid1[1:-1], 'testapp'))
     self.assertEqual(values['eid'], '21')
     self.assertIn('timestamp', values)
     self.assertEqual(parse_message_id(msgid1[1:-1], 'anotherapp'), None)
Exemple #2
0
 def construct_message_id(self, eid):
     return construct_message_id(self._cw.vreg.config.appid, eid,
                                 self.msgid_timestamp)
Exemple #3
0
 def test_nonregr_empty_message_id(self):
     for eid in (1, 12, 123, 1234):
         msgid1 = construct_message_id('testapp', eid, 12)
         self.assertNotEqual(msgid1, '<@testapp.%s>' % gethostname())
Exemple #4
0
 def test_notimestamp(self):
     msgid1 = construct_message_id('testapp', 21, False)
     construct_message_id('testapp', 21, False)
     values = parse_message_id(msgid1, 'testapp')
     self.assertEqual(values, {'eid': '21'})