~marcustomlinson/keeper/add-builddeb-dir

« back to all changes in this revision

Viewing changes to tests/com_canonical_keeper.py

mergeĀ lp:~charlesk/keeper/keeper-tar-create-handle-libarchive-failure-gracefully

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
 
354
354
def helper_start_backup(helper, n_bytes):
355
355
 
 
356
    # are we forcing a fail?
 
357
    main = mockobject.objects[SERVICE_PATH]
 
358
    if main.fail_next_helper_start:
 
359
        main.fail_next_helper_start = False
 
360
        fail('main.fail_next_helper_start was set')
 
361
 
356
362
    helper.log("got start_backup request for %s bytes" % (n_bytes))
357
363
 
358
364
    parent, child = socket.socketpair()
477
483
    o.add_backup_choice = mock_add_backup_choice
478
484
    o.add_restore_choice = mock_add_restore_choice
479
485
    o.get_backup_data = mock_get_backup_data
 
486
    o.fail_next_helper_start = False
480
487
    o.AddMethods(MOCK_IFACE, [
481
488
        ('AddBackupChoice', 'sa{sv}', '',
482
489
         'self.add_backup_choice(self, args[0], args[1])'),
483
490
        ('AddRestoreChoice', 'sa{sv}', '',
484
491
         'self.add_restore_choice(self, args[0], args[1])'),
485
492
        ('GetBackupData', 's', 'ay',
486
 
         'ret = self.get_backup_data(self, args[0])')
 
493
         'ret = self.get_backup_data(self, args[0])'),
 
494
        ('FailNextHelperStart', '', '',
 
495
         'self.fail_next_helper_start = True'),
487
496
    ])
488
497
    o.EmitSignal(
489
498
        OBJECT_MANAGER_IFACE,