Skip to content

Commit 43c82b3

Browse files
committed
test: add upload/download instance method and UploadFileResult branch tests
Add 11 new test classes covering OswExpress.upload_file/download_file instance methods, UploadFileResult branches (LFC source, URL domain extraction, env var domain, target_fpt meta/change_id, osw_express from source controller, invalid source type), and import_with_fallback wiki fallback path. Fix bug in upload_file() where locals() caused duplicate keyword args. Coverage for express.py increased from 79% to 90%.
1 parent e92d47e commit 43c82b3

2 files changed

Lines changed: 438 additions & 0 deletions

File tree

‎src/osw/express.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ def upload_file(
307307
"""
308308
# Preparing all args, kwargs & properties to set for the uploaded file
309309
data = {**locals(), **properties}
310+
# Remove 'self', 'source', and 'properties' to avoid duplicate keyword args
311+
for key in ("self", "source", "properties"):
312+
data.pop(key, None)
310313
# Clean data dict to avoid passing None values
311314
data = {key: value for key, value in data.items() if value is not None}
312315
# Make sure self is passed as osw_express

0 commit comments

Comments
 (0)