Skip to content

Commit

Permalink
We can't have nice things.
Browse files Browse the repository at this point in the history
  • Loading branch information
witten committed Oct 15, 2018
1 parent e323290 commit c1ddc42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/end-to-end/test_borgmatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def generate_configuration(config_path, repository_path):
Generate borgmatic configuration into a file at the config path, and update the defaults so as
to work for testing (including injecting the given repository path).
'''
subprocess.check_call(f'generate-borgmatic-config --destination {config_path}'.split(' '))
subprocess.check_call('generate-borgmatic-config --destination {}'.format(config_path).split(' '))
config = (
open(config_path)
.read()
.replace('user@backupserver:sourcehostname.borg', repository_path)
.replace('- /home', f'- {config_path}')
.replace('- /home', '- {}'.format(config_path))
.replace('- /etc', '')
.replace('- /var/log/syslog*', '')
)
Expand All @@ -32,17 +32,17 @@ def test_borgmatic_command():

try:
subprocess.check_call(
f'borg init --encryption repokey {repository_path}'.split(' '),
'borg init --encryption repokey {}'.format(repository_path).split(' '),
env={'BORG_PASSPHRASE': '', **os.environ},
)

config_path = os.path.join(temporary_directory, 'test.yaml')
generate_configuration(config_path, repository_path)

# Run borgmatic to generate a backup archive, and then list it to make sure it exists.
subprocess.check_call(f'borgmatic --config {config_path}'.split(' '))
subprocess.check_call('borgmatic --config {}'.format(config_path).split(' '))
output = subprocess.check_output(
f'borgmatic --config {config_path} --list --json'.split(' '),
'borgmatic --config {} --list --json'.format(config_path).split(' '),
encoding=sys.stdout.encoding,
)
parsed_output = json.loads(output)
Expand All @@ -52,7 +52,7 @@ def test_borgmatic_command():

# Also exercise the info flag.
output = subprocess.check_output(
f'borgmatic --config {config_path} --info --json'.split(' '),
'borgmatic --config {} --info --json'.format(config_path).split(' '),
encoding=sys.stdout.encoding,
)
parsed_output = json.loads(output)
Expand Down

0 comments on commit c1ddc42

Please sign in to comment.