Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions qase-api-v2-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ Qase TestOps API v2 Specification.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.0.0
- Package version: 1.0.0
- Generator version: 7.4.0
- Generator version: 7.15.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://qase.io](https://qase.io)

## Requirements.
## Requirements

Python 3.7+
Python 3.9+

## Installation & Usage

Expand All @@ -21,10 +20,10 @@ Python 3.7+
If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
pip install qase-api-v2-client
```

(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
(you may need to run `pip` with root permission: `sudo pip install qase-api-v2-client`)

Then import the package:

Expand Down Expand Up @@ -98,12 +97,12 @@ with qase.api_client_v2.ApiClient(configuration) as api_client:

## Documentation for API Endpoints

All URIs are relative to *https://api.qase.io/v2*
All URIs are relative to *<https://api.qase.io/v2>*

Class | Method | HTTP request | Description
Class | Method | HTTP request | Description
--------------|---------------------------------------------------------------|-----------------------------------------------|------------------------------------
*ResultsApi* | [**create_result_v2**](docs/ResultsApi.md#create_result_v2) | **POST** /{project_code}/run/{run_id}/result | (Beta) Create test run result
*ResultsApi* | [**create_results_v2**](docs/ResultsApi.md#create_results_v2) | **POST** /{project_code}/run/{run_id}/results | (Beta) Bulk create test run result
*ResultsApi* | [**create_result_v2**](docs/ResultsApi.md#create_result_v2) | **POST** /{project_code}/run/{run_id}/result | (Beta) Create test run result
*ResultsApi* | [**create_results_v2**](docs/ResultsApi.md#create_results_v2) | **POST** /{project_code}/run/{run_id}/results | (Beta) Bulk create test run result

## Documentation For Models

Expand Down Expand Up @@ -135,6 +134,4 @@ Authentication schemes defined for the API:

## Author

support@qase.io


<support@qase.io>
14 changes: 14 additions & 0 deletions qase-python-commons/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# qase-python-commons@4.0.0

## What's new

- Unsupport Python 3.7 and 3.8. Support Python 3.9, 3.10, 3.11, 3.12, 3.13.
- Updated the `qase-api-client` dependency to the latest version.
- Updated the `qase-api-v2-client` dependency to the latest version.

# qase-python-commons@3.5.8

## What's new

- Updated the `qase-api-client` dependency to the latest version.

# qase-python-commons@3.5.7

## What's new
Expand Down
15 changes: 7 additions & 8 deletions 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.5.7"
version = "4.0.0"
description = "A library for Qase TestOps and Qase Report"
readme = "README.md"
authors = [{name = "Qase Team", email = "support@qase.io"}]
Expand All @@ -18,20 +18,19 @@ classifiers = [
'Topic :: Software Development :: Testing',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
urls = {"Homepage" = "https://github.com/qase-tms/qase-python/tree/main/qase-python-commons"}
requires-python = ">=3.7"
requires-python = ">=3.9"
dependencies = [
"certifi>=2024.2.2",
"attrs>=23.2.0",
"qase-api-client~=1.2.3",
"qase-api-v2-client~=1.2.2",
"qase-api-client~=2.0.0",
"qase-api-v2-client~=2.0.0",
"more_itertools"
]

Expand All @@ -48,8 +47,8 @@ testing = [
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.7
envlist = py{37,38,39,310,311}
minversion = 3.9
envlist = py{39,310,311,312,313}

[testenv]
deps =
Expand Down
19 changes: 11 additions & 8 deletions qase-python-commons/src/qase/commons/models/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ def __init__(self,
def get_id(self) -> str:
return self.id

def get_for_upload(self) -> BytesIO:
def get_for_upload(self) -> tuple:
"""Returns attachment data in format expected by new API client: (filename, filedata)"""

if self.file_path:
with open(self.file_path, "rb") as fc:
content = BytesIO(fc.read())
filedata = fc.read()
else:
if isinstance(self.content, str):
content = BytesIO(bytes(self.content, 'utf-8'))
filedata = bytes(self.content, 'utf-8')
elif isinstance(self.content, bytes):
content = BytesIO(self.content)
content.name = self.file_name
content.mime = self.mime_type

return content
filedata = self.content
else:
# Handle case where content is not str or bytes (e.g., JSON serialized)
filedata = bytes(self.content, 'utf-8')

return (self.file_name, filedata)