Beispiel #1
0
async def test_ignore_startup_delay(time: FakeTime, model: Model,
                                    dest: HelperTestSource,
                                    source: HelperTestSource,
                                    global_info: GlobalInfo):
    time.setNow(time.local(2019, 5, 10))
    global_info.triggerBackupCooldown(timedelta(minutes=10))
    model.ignore_startup_delay = True
    assert model.nextBackup(time.now()) == time.now() - timedelta(minutes=1)
    assert not model.waiting_for_startup
Beispiel #2
0
async def test_wait_for_startup_no_backup(time: FakeTime, model: Model,
                                          dest: HelperTestSource,
                                          source: HelperTestSource,
                                          global_info: GlobalInfo):
    time.setNow(time.local(2019, 5, 10))
    global_info.triggerBackupCooldown(timedelta(minutes=10))
    assert model.nextBackup(time.now()) == time.now() + timedelta(minutes=10)
    assert model.nextBackup(time.now()) == global_info.backupCooldownTime()
    assert model.waiting_for_startup

    time.advance(minutes=10)
    assert model.nextBackup(time.now()) == time.now() - timedelta(minutes=1)
    assert not model.waiting_for_startup