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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.4.0"
".": "1.4.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 17
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
config_hash: ab495a165f0919b37cbf9efbd0f0e6ef
config_hash: 41c337f5cda03b13880617490f82bad0
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.4.1 (2026-02-20)

Full Changelog: [v1.4.0...v1.4.1](https://github.com/CASParser/cas-parser-python/compare/v1.4.0...v1.4.1)

### Chores

* **internal:** remove mock server code ([582f64d](https://github.com/CASParser/cas-parser-python/commit/582f64db76f09909f2c406877633b3db56b492dc))
* update mock server docs ([d2942ae](https://github.com/CASParser/cas-parser-python/commit/d2942aef06e12bb1e57040358b68555f7e28bf15))

## 1.4.0 (2026-02-14)

Full Changelog: [v1.3.2...v1.4.0](https://github.com/CASParser/cas-parser-python/compare/v1.3.2...v1.4.0)
Expand Down
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
# you will need npm installed
$ npx prism mock path/to/your/openapi.yml
```

```sh
$ ./scripts/test
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cas-parser-python"
version = "1.4.0"
version = "1.4.1"
description = "The official Python library for the cas-parser API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

export DEFER_PYDANTIC_BUILD=false

Expand Down
2 changes: 1 addition & 1 deletion src/cas_parser/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "cas_parser"
__version__ = "1.4.0" # x-release-please-version
__version__ = "1.4.1" # x-release-please-version
32 changes: 16 additions & 16 deletions tests/api_resources/cdsl/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class TestFetch:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_request_otp(self, client: CasParser) -> None:
fetch = client.cdsl.fetch.request_otp(
Expand All @@ -30,7 +30,7 @@ def test_method_request_otp(self, client: CasParser) -> None:
)
assert_matches_type(FetchRequestOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_request_otp(self, client: CasParser) -> None:
response = client.cdsl.fetch.with_raw_response.request_otp(
Expand All @@ -44,7 +44,7 @@ def test_raw_response_request_otp(self, client: CasParser) -> None:
fetch = response.parse()
assert_matches_type(FetchRequestOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_streaming_response_request_otp(self, client: CasParser) -> None:
with client.cdsl.fetch.with_streaming_response.request_otp(
Expand All @@ -60,7 +60,7 @@ def test_streaming_response_request_otp(self, client: CasParser) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_verify_otp(self, client: CasParser) -> None:
fetch = client.cdsl.fetch.verify_otp(
Expand All @@ -69,7 +69,7 @@ def test_method_verify_otp(self, client: CasParser) -> None:
)
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_verify_otp_with_all_params(self, client: CasParser) -> None:
fetch = client.cdsl.fetch.verify_otp(
Expand All @@ -79,7 +79,7 @@ def test_method_verify_otp_with_all_params(self, client: CasParser) -> None:
)
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_verify_otp(self, client: CasParser) -> None:
response = client.cdsl.fetch.with_raw_response.verify_otp(
Expand All @@ -92,7 +92,7 @@ def test_raw_response_verify_otp(self, client: CasParser) -> None:
fetch = response.parse()
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_streaming_response_verify_otp(self, client: CasParser) -> None:
with client.cdsl.fetch.with_streaming_response.verify_otp(
Expand All @@ -107,7 +107,7 @@ def test_streaming_response_verify_otp(self, client: CasParser) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_path_params_verify_otp(self, client: CasParser) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"):
Expand All @@ -122,7 +122,7 @@ class TestAsyncFetch:
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_request_otp(self, async_client: AsyncCasParser) -> None:
fetch = await async_client.cdsl.fetch.request_otp(
Expand All @@ -132,7 +132,7 @@ async def test_method_request_otp(self, async_client: AsyncCasParser) -> None:
)
assert_matches_type(FetchRequestOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_request_otp(self, async_client: AsyncCasParser) -> None:
response = await async_client.cdsl.fetch.with_raw_response.request_otp(
Expand All @@ -146,7 +146,7 @@ async def test_raw_response_request_otp(self, async_client: AsyncCasParser) -> N
fetch = await response.parse()
assert_matches_type(FetchRequestOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_streaming_response_request_otp(self, async_client: AsyncCasParser) -> None:
async with async_client.cdsl.fetch.with_streaming_response.request_otp(
Expand All @@ -162,7 +162,7 @@ async def test_streaming_response_request_otp(self, async_client: AsyncCasParser

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_verify_otp(self, async_client: AsyncCasParser) -> None:
fetch = await async_client.cdsl.fetch.verify_otp(
Expand All @@ -171,7 +171,7 @@ async def test_method_verify_otp(self, async_client: AsyncCasParser) -> None:
)
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_verify_otp_with_all_params(self, async_client: AsyncCasParser) -> None:
fetch = await async_client.cdsl.fetch.verify_otp(
Expand All @@ -181,7 +181,7 @@ async def test_method_verify_otp_with_all_params(self, async_client: AsyncCasPar
)
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_verify_otp(self, async_client: AsyncCasParser) -> None:
response = await async_client.cdsl.fetch.with_raw_response.verify_otp(
Expand All @@ -194,7 +194,7 @@ async def test_raw_response_verify_otp(self, async_client: AsyncCasParser) -> No
fetch = await response.parse()
assert_matches_type(FetchVerifyOtpResponse, fetch, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_streaming_response_verify_otp(self, async_client: AsyncCasParser) -> None:
async with async_client.cdsl.fetch.with_streaming_response.verify_otp(
Expand All @@ -209,7 +209,7 @@ async def test_streaming_response_verify_otp(self, async_client: AsyncCasParser)

assert cast(Any, response.is_closed) is True

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_path_params_verify_otp(self, async_client: AsyncCasParser) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"):
Expand Down
16 changes: 8 additions & 8 deletions tests/api_resources/test_access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
class TestAccessToken:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create(self, client: CasParser) -> None:
access_token = client.access_token.create()
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create_with_all_params(self, client: CasParser) -> None:
access_token = client.access_token.create(
expiry_minutes=60,
)
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_create(self, client: CasParser) -> None:
response = client.access_token.with_raw_response.create()
Expand All @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: CasParser) -> None:
access_token = response.parse()
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_streaming_response_create(self, client: CasParser) -> None:
with client.access_token.with_streaming_response.create() as response:
Expand All @@ -59,21 +59,21 @@ class TestAsyncAccessToken:
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create(self, async_client: AsyncCasParser) -> None:
access_token = await async_client.access_token.create()
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncCasParser) -> None:
access_token = await async_client.access_token.create(
expiry_minutes=60,
)
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_create(self, async_client: AsyncCasParser) -> None:
response = await async_client.access_token.with_raw_response.create()
Expand All @@ -83,7 +83,7 @@ async def test_raw_response_create(self, async_client: AsyncCasParser) -> None:
access_token = await response.parse()
assert_matches_type(AccessTokenCreateResponse, access_token, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_streaming_response_create(self, async_client: AsyncCasParser) -> None:
async with async_client.access_token.with_streaming_response.create() as response:
Expand Down
Loading