def test_enqueue(self):
     self.relay._attempt(self.env, 0)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     self.assertEqual(1, len(ret))
     self.assertEqual(2, len(ret[0]))
     self.assertEqual(self.env, ret[0][0])
     self.assertRegexpMatches(ret[0][1], r"[0-9a-fA-F]{32}")
Exemple #2
0
 def test_enqueue(self):
     self.relay._attempt(self.env, 0)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     self.assertEqual(1, len(ret))
     self.assertEqual(2, len(ret[0]))
     self.assertEqual(self.env, ret[0][0])
     self.assertRegexpMatches(ret[0][1], r'[0-9a-fA-F]{32}')
 def test_enqueue(self):
     self.relay._attempt(self.env, 0)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     assert_equal(1, len(ret))
     assert_equal(2, len(ret[0]))
     assert_equal(self.env, ret[0][0])
     assert_regexp_matches(ret[0][1], r'[0-9a-fA-F]{32}')
 def test_enqueue_relayerror(self):
     err = PermanentRelayError("msg failure", Reply("550", "Not Ok"))
     self.relay._attempt(self.env, 0).AndRaise(err)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     self.assertEqual(1, len(ret))
     self.assertEqual(2, len(ret[0]))
     self.assertEqual(self.env, ret[0][0])
     self.assertEqual(err, ret[0][1])
Exemple #5
0
 def test_enqueue_relayerror(self):
     err = PermanentRelayError('msg failure', Reply('550', 'Not Ok'))
     self.relay._attempt(self.env, 0).AndRaise(err)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     self.assertEqual(1, len(ret))
     self.assertEqual(2, len(ret[0]))
     self.assertEqual(self.env, ret[0][0])
     self.assertEqual(err, ret[0][1])
 def test_enqueue_relayerror(self):
     err = PermanentRelayError('msg failure', Reply('550', 'Not Ok'))
     self.relay._attempt(self.env, 0).AndRaise(err)
     self.mox.ReplayAll()
     q = ProxyQueue(self.relay)
     ret = q.enqueue(self.env)
     assert_equal(1, len(ret))
     assert_equal(2, len(ret[0]))
     assert_equal(self.env, ret[0][0])
     assert_equal(err, ret[0][1])