Beispiel #1
0
    def test_get_or_create(self):
        message = 'abcd'
        id = '12335'
        error = create_error(_change(id=id), message=message, attempts=2)
        error.save()

        get = PillowError.get_or_create(_change(id=id), FakePillow())
        self.assertEqual(get.total_attempts, 2)
        self.assertEqual(get.current_attempt, 2)
        self.assertTrue(message in error.error_traceback)

        another_pillow = make_fake_constructed_pillow('FakePillow1', '')
        new = PillowError.get_or_create(_change(id=id), another_pillow)
        self.assertIsNone(new.id)
        self.assertEqual(new.current_attempt, 0)
Beispiel #2
0
def FakePillow():
    return make_fake_constructed_pillow('FakePillow', 'fake-checkpoint')
def make_fake_pillow(pillow_id, **kwargs):
    return make_fake_constructed_pillow(pillow_id, 'fake-constructed-pillow')
Beispiel #4
0
def _get_dummy_pillow():
    from pillowtop.tests.utils import make_fake_constructed_pillow
    return make_fake_constructed_pillow('dummy pillow',
                                        'test_checkpoint_seq_store')
Beispiel #5
0
def _get_dummy_pillow():
    from pillowtop.tests.utils import make_fake_constructed_pillow
    return make_fake_constructed_pillow('dummy pillow', 'test_checkpoint_seq_store')
Beispiel #6
0
def make_fake_pillow(pillow_id, **kwargs):
    return make_fake_constructed_pillow(pillow_id, 'fake-constructed-pillow')