コード例 #1
0
    def test_can_reattempt(self):
        req = {
            'owner_id': '1234',
            'timestamp': 5,
            'attempts': 0,
            'intervals': [10, 20, 30],
            'request': {
                'url': "/foo",
                'method': 'GET'
            }
        }

        self.assertTrue(can_reattempt(req))

        req['attempts'] = 1
        self.assertTrue(can_reattempt(req))

        req['attempts'] = 2
        self.assertTrue(can_reattempt(req))

        req['attempts'] = 3
        self.assertFalse(can_reattempt(req))