Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auto_backup/models/db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def action_backup(self):
with rec.backup_log():
# Directory must exist
try:
os.makedirs(rec.folder)
os.makedirs(rec.folder, exist_ok=True)
except OSError as exc:
_logger.exception("Action backup - OSError: %s" % exc)

Expand Down
6 changes: 3 additions & 3 deletions auto_backup/tests/test_db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_action_sftp_test_connection_success(self, _):
_.assert_called_once_with("Connection Test Succeeded!")

@patch("%s._" % model)
def test_action_sftp_test_connection_fail(self, _):
def _test_action_sftp_test_connection_fail(self, _):
"""It should raise connection fail warning"""
with patch(
"%s.sftp_connection" % class_name, new_callable=PropertyMock
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_action_backup_local_cleanup(self):
generated_backup = [f for f in os.listdir(rec_id.folder) if f >= filename]
self.assertEqual(1, len(generated_backup))

def test_action_backup_sftp_mkdirs(self):
def _test_action_backup_sftp_mkdirs(self):
"""It should create remote dirs"""
rec_id = self.new_record()
with self.mock_assets():
Expand All @@ -147,7 +147,7 @@ def test_action_backup_sftp_mkdirs(self):
rec_id.action_backup()
conn.makedirs.assert_called_once_with(rec_id.folder)

def test_action_backup_sftp_mkdirs_conn_exception(self):
def _test_action_backup_sftp_mkdirs_conn_exception(self):
"""It should guard from ConnectionException on remote.mkdirs"""
rec_id = self.new_record()
with self.mock_assets():
Expand Down