Skip to content

Commit 81c8402

Browse files
chore(test): enable generated tests
1 parent aed61b7 commit 81c8402

16 files changed

Lines changed: 15 additions & 199 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fstripe-minimal-d7db5d2f2f83e89d00e8529a1b6d4ed4746bd306d0e6ffba02f321b576dcc340.yml
33
openapi_spec_hash: e09fbe83a958ffba517bce207e9f9dc1
4-
config_hash: 4435a4ca740728c29979cd8f628c10df
4+
config_hash: 59158dbcf8534e76accb613919408cdb

scripts/mock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ fi
1919

2020
echo "==> Starting mock server with URL ${URL}"
2121

22-
# Run prism mock on the given spec
22+
# Run steady mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24-
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
24+
npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log &
2525

2626
# Wait for server to come online
2727
echo -n "Waiting for server"
28-
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
28+
while ! grep -q "ERROR\|Steady server listening on" ".stdy.log" ; do
2929
echo -n "."
3030
sleep 0.1
3131
done
3232

33-
if grep -q "✖ fatal" ".prism.log"; then
34-
cat .prism.log
33+
if grep -q "ERROR" ".stdy.log"; then
34+
cat .stdy.log
3535
exit 1
3636
fi
3737

3838
echo
3939
else
40-
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
40+
npm exec --package=@stdy/cli@0.15.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL"
4141
fi

scripts/test

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GREEN='\033[0;32m'
99
YELLOW='\033[0;33m'
1010
NC='\033[0m' # No Color
1111

12-
function prism_is_running() {
13-
curl --silent "http://localhost:4010" >/dev/null 2>&1
12+
function steady_is_running() {
13+
curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1
1414
}
1515

1616
kill_server_on_port() {
@@ -25,7 +25,7 @@ function is_overriding_api_base_url() {
2525
[ -n "$TEST_API_BASE_URL" ]
2626
}
2727

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

@@ -36,19 +36,19 @@ fi
3636
if is_overriding_api_base_url ; then
3737
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
3838
echo
39-
elif ! prism_is_running ; then
40-
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
39+
elif ! steady_is_running ; then
40+
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server"
4141
echo -e "running against your OpenAPI spec."
4242
echo
4343
echo -e "To run the server, pass in the path or url of your OpenAPI"
44-
echo -e "spec to the prism command:"
44+
echo -e "spec to the steady command:"
4545
echo
46-
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
46+
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}"
4747
echo
4848

4949
exit 1
5050
else
51-
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
51+
echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}"
5252
echo
5353
fi
5454

tests/api_resources/test_accounts.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@
1717
class TestAccounts:
1818
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
1919

20-
@pytest.mark.skip(reason="Prism tests are disabled")
2120
@parametrize
2221
def test_method_retrieve(self, client: Stripe) -> None:
2322
account = client.accounts.retrieve()
2423
assert_matches_type(Account, account, path=["response"])
2524

26-
@pytest.mark.skip(reason="Prism tests are disabled")
2725
@parametrize
2826
def test_method_retrieve_with_all_params(self, client: Stripe) -> None:
2927
account = client.accounts.retrieve(
3028
expand=["string"],
3129
)
3230
assert_matches_type(Account, account, path=["response"])
3331

34-
@pytest.mark.skip(reason="Prism tests are disabled")
3532
@parametrize
3633
def test_raw_response_retrieve(self, client: Stripe) -> None:
3734
response = client.accounts.with_raw_response.retrieve()
@@ -41,7 +38,6 @@ def test_raw_response_retrieve(self, client: Stripe) -> None:
4138
account = response.parse()
4239
assert_matches_type(Account, account, path=["response"])
4340

44-
@pytest.mark.skip(reason="Prism tests are disabled")
4541
@parametrize
4642
def test_streaming_response_retrieve(self, client: Stripe) -> None:
4743
with client.accounts.with_streaming_response.retrieve() as response:
@@ -59,21 +55,18 @@ class TestAsyncAccounts:
5955
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
6056
)
6157

62-
@pytest.mark.skip(reason="Prism tests are disabled")
6358
@parametrize
6459
async def test_method_retrieve(self, async_client: AsyncStripe) -> None:
6560
account = await async_client.accounts.retrieve()
6661
assert_matches_type(Account, account, path=["response"])
6762

68-
@pytest.mark.skip(reason="Prism tests are disabled")
6963
@parametrize
7064
async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) -> None:
7165
account = await async_client.accounts.retrieve(
7266
expand=["string"],
7367
)
7468
assert_matches_type(Account, account, path=["response"])
7569

76-
@pytest.mark.skip(reason="Prism tests are disabled")
7770
@parametrize
7871
async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None:
7972
response = await async_client.accounts.with_raw_response.retrieve()
@@ -83,7 +76,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None:
8376
account = await response.parse()
8477
assert_matches_type(Account, account, path=["response"])
8578

86-
@pytest.mark.skip(reason="Prism tests are disabled")
8779
@parametrize
8880
async def test_streaming_response_retrieve(self, async_client: AsyncStripe) -> None:
8981
async with async_client.accounts.with_streaming_response.retrieve() as response:

tests/api_resources/test_balance.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@
1717
class TestBalance:
1818
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
1919

20-
@pytest.mark.skip(reason="Prism tests are disabled")
2120
@parametrize
2221
def test_method_retrieve(self, client: Stripe) -> None:
2322
balance = client.balance.retrieve()
2423
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
2524

26-
@pytest.mark.skip(reason="Prism tests are disabled")
2725
@parametrize
2826
def test_method_retrieve_with_all_params(self, client: Stripe) -> None:
2927
balance = client.balance.retrieve(
3028
expand=["string"],
3129
)
3230
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
3331

34-
@pytest.mark.skip(reason="Prism tests are disabled")
3532
@parametrize
3633
def test_raw_response_retrieve(self, client: Stripe) -> None:
3734
response = client.balance.with_raw_response.retrieve()
@@ -41,7 +38,6 @@ def test_raw_response_retrieve(self, client: Stripe) -> None:
4138
balance = response.parse()
4239
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
4340

44-
@pytest.mark.skip(reason="Prism tests are disabled")
4541
@parametrize
4642
def test_streaming_response_retrieve(self, client: Stripe) -> None:
4743
with client.balance.with_streaming_response.retrieve() as response:
@@ -59,21 +55,18 @@ class TestAsyncBalance:
5955
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
6056
)
6157

62-
@pytest.mark.skip(reason="Prism tests are disabled")
6358
@parametrize
6459
async def test_method_retrieve(self, async_client: AsyncStripe) -> None:
6560
balance = await async_client.balance.retrieve()
6661
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
6762

68-
@pytest.mark.skip(reason="Prism tests are disabled")
6963
@parametrize
7064
async def test_method_retrieve_with_all_params(self, async_client: AsyncStripe) -> None:
7165
balance = await async_client.balance.retrieve(
7266
expand=["string"],
7367
)
7468
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
7569

76-
@pytest.mark.skip(reason="Prism tests are disabled")
7770
@parametrize
7871
async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None:
7972
response = await async_client.balance.with_raw_response.retrieve()
@@ -83,7 +76,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncStripe) -> None:
8376
balance = await response.parse()
8477
assert_matches_type(BalanceRetrieveResponse, balance, path=["response"])
8578

86-
@pytest.mark.skip(reason="Prism tests are disabled")
8779
@parametrize
8880
async def test_streaming_response_retrieve(self, async_client: AsyncStripe) -> None:
8981
async with async_client.balance.with_streaming_response.retrieve() as response:

tests/api_resources/test_coupons.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
class TestCoupons:
1919
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
2020

21-
@pytest.mark.skip(reason="Prism tests are disabled")
2221
@parametrize
2322
def test_method_create(self, client: Stripe) -> None:
2423
coupon = client.coupons.create()
2524
assert_matches_type(Coupon, coupon, path=["response"])
2625

27-
@pytest.mark.skip(reason="Prism tests are disabled")
2826
@parametrize
2927
def test_method_create_with_all_params(self, client: Stripe) -> None:
3028
coupon = client.coupons.create(
@@ -44,7 +42,6 @@ def test_method_create_with_all_params(self, client: Stripe) -> None:
4442
)
4543
assert_matches_type(Coupon, coupon, path=["response"])
4644

47-
@pytest.mark.skip(reason="Prism tests are disabled")
4845
@parametrize
4946
def test_raw_response_create(self, client: Stripe) -> None:
5047
response = client.coupons.with_raw_response.create()
@@ -54,7 +51,6 @@ def test_raw_response_create(self, client: Stripe) -> None:
5451
coupon = response.parse()
5552
assert_matches_type(Coupon, coupon, path=["response"])
5653

57-
@pytest.mark.skip(reason="Prism tests are disabled")
5854
@parametrize
5955
def test_streaming_response_create(self, client: Stripe) -> None:
6056
with client.coupons.with_streaming_response.create() as response:
@@ -66,13 +62,11 @@ def test_streaming_response_create(self, client: Stripe) -> None:
6662

6763
assert cast(Any, response.is_closed) is True
6864

69-
@pytest.mark.skip(reason="Prism tests are disabled")
7065
@parametrize
7166
def test_method_list(self, client: Stripe) -> None:
7267
coupon = client.coupons.list()
7368
assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"])
7469

75-
@pytest.mark.skip(reason="Prism tests are disabled")
7670
@parametrize
7771
def test_method_list_with_all_params(self, client: Stripe) -> None:
7872
coupon = client.coupons.list(
@@ -89,7 +83,6 @@ def test_method_list_with_all_params(self, client: Stripe) -> None:
8983
)
9084
assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"])
9185

92-
@pytest.mark.skip(reason="Prism tests are disabled")
9386
@parametrize
9487
def test_raw_response_list(self, client: Stripe) -> None:
9588
response = client.coupons.with_raw_response.list()
@@ -99,7 +92,6 @@ def test_raw_response_list(self, client: Stripe) -> None:
9992
coupon = response.parse()
10093
assert_matches_type(SyncMyCursorIDPage[Coupon], coupon, path=["response"])
10194

102-
@pytest.mark.skip(reason="Prism tests are disabled")
10395
@parametrize
10496
def test_streaming_response_list(self, client: Stripe) -> None:
10597
with client.coupons.with_streaming_response.list() as response:
@@ -117,13 +109,11 @@ class TestAsyncCoupons:
117109
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
118110
)
119111

120-
@pytest.mark.skip(reason="Prism tests are disabled")
121112
@parametrize
122113
async def test_method_create(self, async_client: AsyncStripe) -> None:
123114
coupon = await async_client.coupons.create()
124115
assert_matches_type(Coupon, coupon, path=["response"])
125116

126-
@pytest.mark.skip(reason="Prism tests are disabled")
127117
@parametrize
128118
async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None:
129119
coupon = await async_client.coupons.create(
@@ -143,7 +133,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) ->
143133
)
144134
assert_matches_type(Coupon, coupon, path=["response"])
145135

146-
@pytest.mark.skip(reason="Prism tests are disabled")
147136
@parametrize
148137
async def test_raw_response_create(self, async_client: AsyncStripe) -> None:
149138
response = await async_client.coupons.with_raw_response.create()
@@ -153,7 +142,6 @@ async def test_raw_response_create(self, async_client: AsyncStripe) -> None:
153142
coupon = await response.parse()
154143
assert_matches_type(Coupon, coupon, path=["response"])
155144

156-
@pytest.mark.skip(reason="Prism tests are disabled")
157145
@parametrize
158146
async def test_streaming_response_create(self, async_client: AsyncStripe) -> None:
159147
async with async_client.coupons.with_streaming_response.create() as response:
@@ -165,13 +153,11 @@ async def test_streaming_response_create(self, async_client: AsyncStripe) -> Non
165153

166154
assert cast(Any, response.is_closed) is True
167155

168-
@pytest.mark.skip(reason="Prism tests are disabled")
169156
@parametrize
170157
async def test_method_list(self, async_client: AsyncStripe) -> None:
171158
coupon = await async_client.coupons.list()
172159
assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"])
173160

174-
@pytest.mark.skip(reason="Prism tests are disabled")
175161
@parametrize
176162
async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> None:
177163
coupon = await async_client.coupons.list(
@@ -188,7 +174,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncStripe) -> N
188174
)
189175
assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"])
190176

191-
@pytest.mark.skip(reason="Prism tests are disabled")
192177
@parametrize
193178
async def test_raw_response_list(self, async_client: AsyncStripe) -> None:
194179
response = await async_client.coupons.with_raw_response.list()
@@ -198,7 +183,6 @@ async def test_raw_response_list(self, async_client: AsyncStripe) -> None:
198183
coupon = await response.parse()
199184
assert_matches_type(AsyncMyCursorIDPage[Coupon], coupon, path=["response"])
200185

201-
@pytest.mark.skip(reason="Prism tests are disabled")
202186
@parametrize
203187
async def test_streaming_response_list(self, async_client: AsyncStripe) -> None:
204188
async with async_client.coupons.with_streaming_response.list() as response:

0 commit comments

Comments
 (0)