duplicity.backends._testbackend module

class duplicity.backends._testbackend.BackendErrors[source]

Bases: object

DELAY_FIX_MS = 'DUP_FAIL_DELAY_FIX_MS'
DELAY_RANDOM_MS = 'DUP_FAIL_DELAY_RANDOM_MS'
FAIL_SYSTEM_EXIT = 'DUP_FAIL_BY_SYSTEM_EXIT'
FAIL_WITH_EXCEPTION = 'DUP_FAIL_WITH_EXCEPTION'
LAST_BYTE_MISSING = 'DUP_FAIL_LAST_BYTE_MISSING'
SKIP_PUT_SILENT = 'DUP_FAIL_SKIP_PUT_SILENT'
WAIT_FOR_OTHER_VOLUME = 'DUP_FAIL_WAIT_FOR_VOLUME'
class duplicity.backends._testbackend._TestBackend(parsed_url)[source]

Bases: Backend

Use this backend to test/create certain error situations

errors get triggered via ENV Vars, see class BackendErrors

_TestBackend__hash_file(filename)
_TestBackend__hash_fileobj(fileobj)
__init__(parsed_url)[source]
_close()[source]
static _delay()[source]

sleep a random amount of milliseconds if ENV set

_delete(filename)[source]
_delete_list(filenames)[source]
_error_code(operation, e)[source]
static _fail_by_sys_exit(filename)[source]
static _fail_with_exception(filename)[source]
_get(filename, local_path)[source]
_list()[source]
_move(source_path, remote_filename)[source]
_put(source_path, remote_filename)[source]
_query(filename)[source]
_query_list(filename_list)[source]
_remove_last_byte(filename)[source]
_retry_cleanup()[source]
static _skip_put_silent(filename)[source]

retrun true if file should be skipped silently

_validate(remote_filename, size, source_path=None, **kwargs)[source]
_wait_for_other_volume(filename)[source]
duplicity.backends._testbackend.random() x in the interval [0, 1).