예제 #1
0
    def test_correlates_with1(self):
        """Request does correlate with 'message' whose id matches"""
        test_id = "1234567835415432534"
        request = Request(id=test_id, dispatcher=lambda o: o, args=1)

        fake_reply = FakeReply(id=test_id)

        self.assertTrue(request.correlates_with(fake_reply))
예제 #2
0
    def test_correlates_with0(self):
        """Request does not correlate with 'message' whose id does not match"""
        test_id = "1234567835415432534"
        request = Request(id=test_id, dispatcher=lambda o: o, args=1)

        fake_reply = FakeReply(id=test_id[0:-1])

        self.assertFalse(request.correlates_with(fake_reply))