Skip to content

Commit

Permalink
fix : an issue with the upload_attachment method
Browse files Browse the repository at this point in the history
```log
"attachments": [attach.hash for attach in attached],
AttributeError: 'list' object has no attribute 'hash'
```
  • Loading branch information
gibiw committed Sep 27, 2024
1 parent 36e3468 commit 6be7433
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions qase-python-commons/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## What's new

Fixed an issue with the `upload_attachment` method:

```log
"attachments": [attach.hash for attach in attached],
AttributeError: 'list' object has no attribute 'hash'
```

# [email protected]

## What's new

Show a test run link in end of log.

# [email protected]
Expand Down
2 changes: 1 addition & 1 deletion qase-python-commons/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-python-commons"
version = "3.1.7"
version = "3.1.8"
description = "A library for Qase TestOps and Qase Report"
readme = "README.md"
authors = [{name = "Qase Team", email = "[email protected]"}]
Expand Down
4 changes: 2 additions & 2 deletions qase-python-commons/src/qase/commons/client/api_v1_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _prepare_result(self, project_code: str, result: Result) -> Dict:
for attachment in result.attachments:
attach_id = self._upload_attachment(project_code, attachment)
if attach_id:
attached.append(attach_id)
attached.extend(attach_id)

steps = []
for step in result.steps:
Expand Down Expand Up @@ -254,7 +254,7 @@ def _prepare_step(self, project_code: str, step: Step) -> Dict:
for file in step.attachments:
attach_id = self._upload_attachment(project_code, file)
if attach_id:
uploaded_attachments.append(attach_id)
uploaded_attachments.extend(attach_id)
prepared_step['attachments'] = [attach.hash for attach in uploaded_attachments]

if step.steps:
Expand Down

0 comments on commit 6be7433

Please sign in to comment.