From 43da6d5a738825cfd355a9690d9bc0f857f34b87 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:20:34 -0800 Subject: [PATCH] test_set_dir_root_folder_named_slash --- api/python/tests/integration/test_packages.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/python/tests/integration/test_packages.py b/api/python/tests/integration/test_packages.py index 2864569fe29..b4aa6e4b5ae 100644 --- a/api/python/tests/integration/test_packages.py +++ b/api/python/tests/integration/test_packages.py @@ -623,7 +623,16 @@ def test_s3_set_dir(self): list_object_versions_mock.assert_called_with('bucket', 'foo/') + + def test_set_dir_root_folder_named_slash(self): + with patch('quilt3.packages.list_object_versions') as list_object_versions_mock: + list_object_versions_mock.return_value = ([ + dict(Key='/foo/a.txt', VersionId='xyz', IsLatest=True, Size=10), + ], []) + pkg = Package() pkg.set_dir('bar', 's3://bucket//foo') # top-level '/' folder + assert True, "No exception raised for top-level folder named '/'" + def test_set_dir_wrong_update_policy(self): """Verify non existing update policy raises value error."""