Changeset 41067 for trunk/backups/backup_test.py
- Timestamp:
- Nov 5, 2019, 3:18:35 PM (7 years ago)
- Location:
- trunk/backups
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
backup_test.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/backups
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/IPP-308_move_backups_folder/backups merged eligible /branches/ipp-350_add_to_jira_conf_backups merged eligible /trunk/backups merged eligible /branches/czw_branch/20160809/backups 39651-39924 /branches/czw_branch/20170908/backups 40128-40486 /branches/ipp-259_genericise_backups/backups 40910-40966
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/backups/backup_test.py
r40967 r41067 596 596 assert os.path.exists(expected4dir) 597 597 598 def test_rsync_with_subdirs_option(self, tmpdir): 599 config = make_default_config(tmpdir, ['bck1', 'bck2']) 600 source1 = os.path.join(tmpdir, "some_dir") 601 source2 = os.path.join(tmpdir, "some_other_dir") 602 file_in_dir = os.path.join(source1, "and_specific_file.jpeg") 603 file_in_other_dir = os.path.join(source2, "another_file.jpeg") 604 os.makedirs(source1) 605 os.makedirs(source2) 606 Path(file_in_dir).touch() 607 Path(file_in_other_dir).touch() 608 609 config['RSYNC'] = \ 610 { 'sources' : f"{source1}, {source2}" 611 , 'additional_args' : "-a --progress -v" 612 , 'sub-dirs' : "subdir_with_better_name1, subdir_with_better_name2" 613 } 614 615 schema = ConfigSchema(None) 616 schema.add_section(bckup.DEFAULT_SCHEMA_SECTION) 617 schema.add_section(bckup.RSYNC_SCHEMA_SECTION) 618 619 backy = Backup(config, schema) 620 621 expected_bak1_src1_dir = os.path.join(tmpdir, 'bck1', 'subdir_with_better_name1', 'some_dir') 622 expected_bak1_src1_file = os.path.join(tmpdir, 'bck1', 'subdir_with_better_name1', 'some_dir', 'and_specific_file.jpeg') 623 expected_bak1_src2_dir = os.path.join(tmpdir, 'bck1', 'subdir_with_better_name2', 'some_other_dir') 624 expected_bak1_src2_file = os.path.join(tmpdir, 'bck1', 'subdir_with_better_name2', 'some_other_dir', 'another_file.jpeg') 625 expected_bak2_src1_dir = os.path.join(tmpdir, 'bck2', 'subdir_with_better_name1', 'some_dir') 626 expected_bak2_src1_file = os.path.join(tmpdir, 'bck2', 'subdir_with_better_name1', 'some_dir', 'and_specific_file.jpeg') 627 expected_bak2_src2_dir = os.path.join(tmpdir, 'bck2', 'subdir_with_better_name2', 'some_other_dir') 628 expected_bak2_src2_file = os.path.join(tmpdir, 'bck2', 'subdir_with_better_name2', 'some_other_dir', 'another_file.jpeg') 629 assert not os.path.exists(expected_bak1_src1_dir) 630 assert not os.path.exists(expected_bak1_src1_file) 631 assert not os.path.exists(expected_bak1_src2_dir) 632 assert not os.path.exists(expected_bak1_src2_file) 633 assert not os.path.exists(expected_bak2_src1_dir) 634 assert not os.path.exists(expected_bak2_src1_file) 635 assert not os.path.exists(expected_bak2_src2_dir) 636 assert not os.path.exists(expected_bak2_src2_file) 637 backy._run_rsync() 638 assert os.path.exists(expected_bak1_src1_dir) 639 assert os.path.exists(expected_bak1_src1_file) 640 assert os.path.exists(expected_bak1_src2_dir) 641 assert os.path.exists(expected_bak1_src2_file) 642 assert os.path.exists(expected_bak2_src1_dir) 643 assert os.path.exists(expected_bak2_src1_file) 644 assert os.path.exists(expected_bak2_src2_dir) 645 assert os.path.exists(expected_bak2_src2_file) 598 646 599 647 @pytest.mark.skip(reason="Requires a fake database to be setup")
Note:
See TracChangeset
for help on using the changeset viewer.
