Skip to content
Draft
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
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Coverage gate for the generated SDK.
#
# pytest-cov reads this file automatically for `make test` / `make cover` / tox,
# all of which run `pytest --cov=aspose_barcode_cloud`. The build fails when line
# coverage of the SDK drops below the 80% requirement (see the repo Agents.md).
[run]
source = aspose_barcode_cloud

[report]
fail_under = 80
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)

- API version: 4.0
- Package version: 26.6.0
- Package version: 26.7.0

## SDK and API Version Compatibility:

Expand Down
4 changes: 2 additions & 2 deletions aspose_barcode_cloud/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
self.rest_client = RESTClientObject(configuration)
self.default_headers = {
"x-aspose-client": "python sdk",
"x-aspose-client-version": "26.6.0",
"x-aspose-client-version": "26.7.0",
}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "Aspose-Barcode-SDK/26.6.0/python"
self.user_agent = "Aspose-Barcode-SDK/26.7.0/python"

def __del__(self):
self.rest_client.close()
Expand Down
20 changes: 0 additions & 20 deletions aspose_barcode_cloud/api_response.py

This file was deleted.

2 changes: 1 addition & 1 deletion aspose_barcode_cloud/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: 4.0\n"
"SDK Package Version: 26.6.0".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 26.7.0".format(env=sys.platform, pyversion=sys.version)
)

@staticmethod
Expand Down
210 changes: 0 additions & 210 deletions aspose_barcode_cloud/exceptions.py

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/check-badges.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pushd "${SCRIPT_DIR}/.." >/dev/null
fi
done

(grep -oP '[^/]+\.yml/badge.svg(?!\?branch=main)' "${readme_file}" || echo ) | while read -r badge_without_branch; do
(grep -oP '[^/]+\.yml/badge.svg(?!\?branch=(main|v4)\b)' "${readme_file}" || echo ) | while read -r badge_without_branch; do
if [ -z "${badge_without_branch}" ]; then continue; fi
>&2 echo "Badge without branch \"${badge_without_branch}\""
exit 1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup, find_packages

NAME = "aspose-barcode-cloud"
VERSION = "26.6.0"
VERSION = "26.7.0"
# To install the library, run the following
#
# python setup.py install
Expand Down
63 changes: 63 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# coding: utf-8

"""Shared pytest fixtures for the offline request-building tests.

Provides the mocked ``RESTClientObject`` transport and an ``ApiClient`` wired to it
(the same pattern as ``test_headers.py``), so the ``test_*_offline.py`` files can drive
every generated API method without a single live API call.
"""

import json
import typing
from unittest import mock

import pytest

from aspose_barcode_cloud.api_client import ApiClient
from aspose_barcode_cloud.configuration import Configuration
from aspose_barcode_cloud.rest import RESTClientObject

FILE_URL: typing.Final = "https://barcode.example/image.png"

BARCODES_JSON: typing.Final = json.dumps(
{"barcodes": [{"barcodeValue": "Test", "type": "QR", "region": [{"x": 1, "y": 2}], "checksum": "123"}]}
).encode("utf-8")


class _FakeRestResponse:
"""Explicit stand-in for ``rest.RESTResponse`` returned by the mocked transport."""

def __init__(self, data=BARCODES_JSON, headers=None):
# type: (bytes, typing.Optional[typing.Dict[str, str]]) -> None
self.status = 200
self.reason = "OK"
self.data = data
self._headers = headers if headers is not None else {"Content-Type": "application/json"}

def getheaders(self):
# type: () -> typing.Dict[str, str]
return self._headers

def getheader(self, name, default=None):
# type: (str, typing.Optional[str]) -> typing.Optional[str]
return self._headers.get(name, default)


@pytest.fixture()
def rest_client():
# type: () -> mock.Mock
client = mock.Mock(spec_set=RESTClientObject)
for method in ("GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH", "DELETE"):
getattr(client, method).return_value = _FakeRestResponse()
return client


@pytest.fixture()
def api_client(rest_client):
# type: (mock.Mock) -> ApiClient
client = ApiClient(
Configuration(access_token="fake-token", host="http://localhost"),
cookie="session=fake-cookie",
)
client.rest_client = rest_client
return client
Loading
Loading