Skip to content

Commit 58208f9

Browse files
committed
Fix test_upload_from_directory_invalid_artifact_name()
Signed-off-by: Tobias Wolf <wolf@b1-systems.de>
1 parent b9b81ce commit 58208f9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/s3/test_s3_artifacts.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,6 @@ def __init__(self, cname):
235235
artifacts.upload_from_directory(env.cname, env.tmp_path)
236236

237237

238-
@pytest.mark.skip(
239-
reason="needs fix, see https://github.com/gardenlinux/python-gardenlinux-lib/pull/236"
240-
)
241238
def test_upload_from_directory_invalid_artifact_name(s3_setup):
242239
"""
243240
Raise RuntimeError if artifact file does not start with cname.
@@ -252,10 +249,12 @@ def test_upload_from_directory_invalid_artifact_name(s3_setup):
252249

253250
artifacts = S3Artifacts(env.bucket_name)
254251

255-
# Act / Assert
256-
with pytest.raises(RuntimeError, match="does not start with cname"):
257-
artifacts.upload_from_directory(env.cname, env.tmp_path)
252+
# Act
253+
artifacts.upload_from_directory(env.cname, env.tmp_path)
258254

255+
# Assert
256+
bucket = env.s3.Bucket(env.bucket_name)
257+
assert len(list(bucket.objects.filter(Prefix=f"meta/singles/{env.cname}"))) == 1
259258

260259
def test_upload_from_directory_commit_mismatch_raises(s3_setup):
261260
"""Raise RuntimeError when commit ID is not matching with cname."""

0 commit comments

Comments
 (0)