- Timestamp:
- Oct 22, 2019, 2:30:49 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/website_backup_test.py
r40958 r40962 3 3 from pathlib import Path 4 4 5 import backups.backup as bckup 6 from backups.website_backup import WebsiteBackup 7 from backups.utils.config_parse_helper import ConfigSchema 5 import backup as bckup 6 import website_backup as webbck_mod 7 from website_backup import WebsiteBackup 8 from utils.config_parse_helper import ConfigSchema 8 9 9 10 WEBSITE_TEST_CONFIG = os.path.join(os.path.dirname(__file__), … … 31 32 wb = WebsiteBackup(config_file=WEBSITE_TEST_CONFIG) 32 33 self.assert_defaults(wb) 34 35 36 class TestFullRunFromMain(object): 37 38 def test_main_loads_and_runs_fine_when_given_config(self, tmpdir): 39 config = configparser.ConfigParser() 40 bpath1 = os.path.join(tmpdir, "path/1") 41 bpath2 = os.path.join(tmpdir, "path/2") 42 config['DEFAULT'] = \ 43 { 'backup_paths' : f"{bpath1}, {bpath2}" 44 , 'source_machine' : 'rocket' 45 , 'verbose' : 'True' 46 } 47 tar_source = os.path.join(tmpdir, "tar/source") 48 config['TAR'] = \ 49 { 'sources' : f"{tar_source}" 50 , 'additional_args' : "--verbose -z -p -cf" 51 , 'target_filename' : 'svnroot.tar.gz' 52 , 'prefix_date' : 'False' 53 } 54 os.makedirs(bpath1) 55 os.makedirs(bpath2) 56 os.makedirs(tar_source) 57 58 schema = ConfigSchema(None) 59 schema.add_section(bckup.DEFAULT_SCHEMA_SECTION) 60 schema.add_section(bckup.TAR_SCHEMA_SECTION) 61 62 webbck_mod.main(config, schema) 63 assert True is True 33 64 34 65
Note:
See TracChangeset
for help on using the changeset viewer.
