IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41065


Ignore:
Timestamp:
Nov 5, 2019, 1:41:25 PM (7 years ago)
Author:
fairlamb
Message:

test that excluding files as additional args works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ipp-350_add_to_jira_conf_backups/confluence_backup_test.py

    r41061 r41065  
    3838        { 'sources' : (f"{os.path.join(tmpdir, 'rsync_source_dir1')},"
    3939                       f"{os.path.join(tmpdir, 'rsync_source_dir2')}")
    40         , 'additional_args' : '-a --delete-after'
     40        , 'additional_args' : '-a --delete-after --exclude exclude_me_if_you_like'
    4141        , 'sub-dirs' : 'conf_subdir1, conf_subdir2'
    4242        }
     
    9393    file_in_rsync_dir1 = os.path.join(rsync_source_dir1, "some_file_to_rsync")
    9494    file_in_rsync_dir2 = os.path.join(rsync_source_dir2, "some_other_file_to_rsync")
     95    exluded_file = os.path.join(rsync_source_dir1, "exclude_me_if_you_like")
    9596    os.makedirs(rsync_source_dir1)
    9697    os.makedirs(rsync_source_dir2)
    9798    Path(file_in_rsync_dir1).touch()
    9899    Path(file_in_rsync_dir2).touch()
     100    Path(exluded_file).touch()
    99101    assert os.path.exists(file_in_rsync_dir1)
    100102    assert os.path.exists(file_in_rsync_dir2)
     103    assert os.path.exists(exluded_file)
    101104
    102105
     
    342345        assert not os.path.exists(expected_file_bak1_dir2)
    343346        assert not os.path.exists(expected_file_bak2_dir2)
     347        an_excluded_file = os.path.join(expected_confluence_host_rsync1, "exclude_me_if_you_like")
     348        assert not os.path.exists(an_excluded_file)
    344349
    345350        rsync_result = cb._run_rsync()
     
    359364        assert os.path.exists(expected_file_bak1_dir2)
    360365        assert os.path.exists(expected_file_bak2_dir2)
     366        assert not os.path.exists(an_excluded_file)
Note: See TracChangeset for help on using the changeset viewer.