-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto_backup: allow to change the format of backup #1333
Changes from all commits
8c6751f
481d4f5
97293db
25b48b9
eab4bb1
bc063be
cc270b2
e67faef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,18 +175,6 @@ def test_action_backup_sftp_remote_open(self): | |
'wb' | ||
) | ||
|
||
def test_action_backup_sftp_remote_open(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this test was removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your're right |
||
""" It should open remote file w/ proper args """ | ||
rec_id = self.new_record() | ||
with self.mock_assets() as assets: | ||
with self.patch_filtered_sftp(rec_id): | ||
conn = rec_id.sftp_connection().__enter__() | ||
rec_id.action_backup() | ||
conn.open.assert_called_once_with( | ||
assets['os'].path.join(), | ||
'wb' | ||
) | ||
|
||
def test_action_backup_all_search(self): | ||
""" It should search all records """ | ||
rec_id = self.new_record() | ||
|
@@ -241,8 +229,20 @@ def test_sftp_connection_return(self, pysftp): | |
pysftp.Connection(), res, | ||
) | ||
|
||
def test_filename(self): | ||
def test_filename_default(self): | ||
""" It should not error and should return a .dump.zip file str """ | ||
now = datetime.now() | ||
res = self.Model.filename(now) | ||
self.assertTrue(res.endswith(".dump.zip")) | ||
|
||
def test_filename_zip(self): | ||
""" It should return a dump.zip filename""" | ||
now = datetime.now() | ||
res = self.Model.filename(now, ext='zip') | ||
self.assertTrue(res.endswith(".dump.zip")) | ||
|
||
def test_filename_dump(self): | ||
""" It should return a dump filename""" | ||
now = datetime.now() | ||
res = self.Model.filename(now, ext='dump') | ||
self.assertTrue(res.endswith(".dump")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@foutoucour the if statement can be removed since you loop on the for.