Skip to content

Commit

Permalink
Fix parameter initialisation in test helper
Browse files Browse the repository at this point in the history
Addresses an issue identified by sonarqube during implementing BAR-10
where a variable is initialised to an empty list within a function
definition.
  • Loading branch information
mikewallace1979 committed Aug 14, 2023
1 parent d5c28e3 commit 8b9b312
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_barman_cloud_backup_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ def _get_sorted_files_for_backup(self, backup_metadata, backup_id):
files_for_backup += sorted(additional_files)
return files_for_backup

def _create_catalog(self, backup_metadata, wals=[]):
def _create_catalog(self, backup_metadata, wals=None):
"""
Create a mock CloudBackupCatalog from the supplied data so that we can provide
a work-alike CloudBackupCatalog to the code-under-test without also including
the CloudBackupCatalog logic in the tests.
"""
if wals is None:
wals = []
# Copy so that we don't affect the state the tests are using when the
# code under test removes backups from the mock catalog
backup_state = backup_metadata.copy()
Expand Down

0 comments on commit 8b9b312

Please sign in to comment.