This repository has been archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Preliminary fix for issue #163 * TypeError: add_tag() missing 1 required positional argument: 'tag_string' * Changed the type column * changed the open mode * Changed full_backup() and added pytest test * Changed inc_backup() and added pytest test * prepared test_inc_backup() test * Added the tag passing facilities to autoxtrabackup * Changed the sequence of input for backup_tags.txt * Removing quotes for status value
- Loading branch information
Shahriyar Rzayev
authored
Nov 7, 2017
1 parent
1d613d1
commit 6d5bb25
Showing
6 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# PyTest file for testing Backup class | ||
from master_backup_script.backuper import Backup | ||
from general_conf.generalops import GeneralClass | ||
|
||
class TestBackup: | ||
|
||
def test_add_tag(self): | ||
# Method for checking the add_tag() static method. All parameters are hard coded. | ||
gen_obj = GeneralClass() | ||
for conf_files in gen_obj.xb_configs.split(): | ||
if '2_3' in conf_files and '5_6' in conf_files: | ||
obj = Backup(config='{}/{}'.format(gen_obj.testpath, conf_files), dry_run=0, tag="My first full backup") | ||
backup_name = obj.recent_full_backup_file() | ||
obj.add_tag(backup_dir=obj.backupdir, backup_name=backup_name, type='Full', tag_string=obj.tag) | ||
|
||
def test_full_backup(self): | ||
# Method for running full_backup() | ||
gen_obj = GeneralClass() | ||
for conf_files in gen_obj.xb_configs.split(): | ||
if '2_3' in conf_files and '5_6' in conf_files: | ||
obj = Backup(config='{}/{}'.format(gen_obj.testpath, conf_files), dry_run=0, tag="My first full backup") | ||
obj.full_backup() | ||
|
||
def test_inc_backup(self): | ||
# Method for running inc_backup() | ||
gen_obj = GeneralClass() | ||
for conf_files in gen_obj.xb_configs.split(): | ||
if '2_3' in conf_files and '5_6' in conf_files: | ||
obj = Backup(config='{}/{}'.format(gen_obj.testpath, conf_files), dry_run=0, tag="My first inc backup") | ||
obj.inc_backup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters