From e8a089784fa22400470f7ca3bb94e5d76a826791 Mon Sep 17 00:00:00 2001 From: Yiming Yang Date: Wed, 19 Feb 2025 13:25:37 -0800 Subject: [PATCH] fix tests --- strato/tests/test_cp.py | 2 +- strato/tests/test_sync.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/strato/tests/test_cp.py b/strato/tests/test_cp.py index bed1a26..b0a87e0 100644 --- a/strato/tests/test_cp.py +++ b/strato/tests/test_cp.py @@ -35,7 +35,7 @@ def test_cp_dir_gcp(capsys): def test_cp_file_local(capsys): cp.main(["file1", "/bar/foo", "--dryrun"]) - assert "cp file1 /bar/foo\n" == capsys.readouterr().out + assert "mkdir -p /bar\ncp file1 /bar/foo\n" == capsys.readouterr().out def test_cp_dir_local(capsys): diff --git a/strato/tests/test_sync.py b/strato/tests/test_sync.py index 156a36b..8747dee 100644 --- a/strato/tests/test_sync.py +++ b/strato/tests/test_sync.py @@ -3,20 +3,20 @@ def test_sync_aws(capsys): - sync.main(["file1", "s3://foo/bar/", "--dryrun"]) + sync.main(["folder1", "s3://foo/bar/", "--dryrun"]) assert ( - "aws s3 sync --delete --only-show-errors file1 s3://foo/bar/\n" == capsys.readouterr().out + "aws s3 sync --delete --only-show-errors folder1 s3://foo/bar/\n" == capsys.readouterr().out ) def test_sync_gcp(capsys): - sync.main(["file1", "gs://foo/bar/", "--dryrun"]) + sync.main(["folder1", "gs://foo/bar/", "--dryrun"]) assert ( - gcloud + " rsync --delete-unmatched-destination-objects -r file1 gs://foo/bar/\n" + gcloud + " rsync --delete-unmatched-destination-objects -r folder1 gs://foo/bar/\n" == capsys.readouterr().out ) def test_sync_local(capsys): - sync.main(["file1", "/bar/foo", "--dryrun"]) - assert "rsync -r --delete file1 /bar\n" == capsys.readouterr().out + sync.main(["folder1", "/bar/foo", "--dryrun"]) + assert "rsync -r --delete folder1/ /bar/foo/\n" == capsys.readouterr().out