def test_valid_rsync_includes_returns_correct_list(tmp_path): """Test that the rsync includes in the correct """ flow_cylc_content = """ [scheduling] initial cycle point = 2020-01-01 [[dependencies]] graph = "blah => deeblah" [scheduler] install = dir/, dir2/, file1, file2 allow implicit tasks = True """ flow_cylc = tmp_path.joinpath(SuiteFiles.FLOW_FILE) flow_cylc.write_text(flow_cylc_content) config = SuiteConfig(suite="rsynctest", fpath=flow_cylc, options=Mock(spec=[])) rsync_includes = SuiteConfig.get_validated_rsync_includes(config) assert rsync_includes == ['dir/', 'dir2/', 'file1', 'file2']
def test_valid_rsync_includes_returns_correct_list(): """Test that the rsync includes in the correct """ flow_cylc_content = """ [scheduling] initial cycle point = 2020-01-01 [[dependencies]] graph = "blah => deeblah" [scheduler] install = dir/, dir2/, file1, file2 """ with TemporaryDirectory() as temp_dir: flow_cylc = Path(temp_dir, "flow.cylc") with flow_cylc.open(mode="w") as f: f.write(flow_cylc_content) f.flush() config = SuiteConfig(suite="rsynctest", fpath=flow_cylc) rsync_includes = SuiteConfig.get_validated_rsync_includes(config) assert rsync_includes == ['dir/', 'dir2/', 'file1', 'file2']