Skip to content

Commit

Permalink
docs(examples): use named params more (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jul 15, 2024
1 parent 34c9a35 commit 769559c
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 372 deletions.
68 changes: 34 additions & 34 deletions tests/api_resources/hris/benefits/test_individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class TestIndividuals:
@parametrize
def test_method_enroll_many(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
)
assert_matches_type(SyncSinglePage[EnrolledIndividual], individual, path=["response"])

@parametrize
def test_raw_response_enroll_many(self, client: Finch) -> None:
response = client.hris.benefits.individuals.with_raw_response.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
)

Expand All @@ -46,7 +46,7 @@ def test_raw_response_enroll_many(self, client: Finch) -> None:
@parametrize
def test_streaming_response_enroll_many(self, client: Finch) -> None:
with client.hris.benefits.individuals.with_streaming_response.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
) as response:
assert not response.is_closed
Expand All @@ -61,21 +61,21 @@ def test_streaming_response_enroll_many(self, client: Finch) -> None:
def test_path_params_enroll_many(self, client: Finch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
client.hris.benefits.individuals.with_raw_response.enroll_many(
"",
benefit_id="",
individuals=[{}],
)

@parametrize
def test_method_enrolled_ids(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.enrolled_ids(
"string",
"benefit_id",
)
assert_matches_type(IndividualEnrolledIDsResponse, individual, path=["response"])

@parametrize
def test_raw_response_enrolled_ids(self, client: Finch) -> None:
response = client.hris.benefits.individuals.with_raw_response.enrolled_ids(
"string",
"benefit_id",
)

assert response.is_closed is True
Expand All @@ -86,7 +86,7 @@ def test_raw_response_enrolled_ids(self, client: Finch) -> None:
@parametrize
def test_streaming_response_enrolled_ids(self, client: Finch) -> None:
with client.hris.benefits.individuals.with_streaming_response.enrolled_ids(
"string",
"benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -106,22 +106,22 @@ def test_path_params_enrolled_ids(self, client: Finch) -> None:
@parametrize
def test_method_retrieve_many_benefits(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
)
assert_matches_type(SyncSinglePage[IndividualBenefit], individual, path=["response"])

@parametrize
def test_method_retrieve_many_benefits_with_all_params(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
individual_ids="d675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a",
)
assert_matches_type(SyncSinglePage[IndividualBenefit], individual, path=["response"])

@parametrize
def test_raw_response_retrieve_many_benefits(self, client: Finch) -> None:
response = client.hris.benefits.individuals.with_raw_response.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
)

assert response.is_closed is True
Expand All @@ -132,7 +132,7 @@ def test_raw_response_retrieve_many_benefits(self, client: Finch) -> None:
@parametrize
def test_streaming_response_retrieve_many_benefits(self, client: Finch) -> None:
with client.hris.benefits.individuals.with_streaming_response.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -146,28 +146,28 @@ def test_streaming_response_retrieve_many_benefits(self, client: Finch) -> None:
def test_path_params_retrieve_many_benefits(self, client: Finch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
client.hris.benefits.individuals.with_raw_response.retrieve_many_benefits(
"",
benefit_id="",
)

@parametrize
def test_method_unenroll_many(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.unenroll_many(
"string",
benefit_id="benefit_id",
)
assert_matches_type(SyncSinglePage[UnenrolledIndividual], individual, path=["response"])

@parametrize
def test_method_unenroll_many_with_all_params(self, client: Finch) -> None:
individual = client.hris.benefits.individuals.unenroll_many(
"string",
benefit_id="benefit_id",
individual_ids=["string", "string", "string"],
)
assert_matches_type(SyncSinglePage[UnenrolledIndividual], individual, path=["response"])

@parametrize
def test_raw_response_unenroll_many(self, client: Finch) -> None:
response = client.hris.benefits.individuals.with_raw_response.unenroll_many(
"string",
benefit_id="benefit_id",
)

assert response.is_closed is True
Expand All @@ -178,7 +178,7 @@ def test_raw_response_unenroll_many(self, client: Finch) -> None:
@parametrize
def test_streaming_response_unenroll_many(self, client: Finch) -> None:
with client.hris.benefits.individuals.with_streaming_response.unenroll_many(
"string",
benefit_id="benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -192,7 +192,7 @@ def test_streaming_response_unenroll_many(self, client: Finch) -> None:
def test_path_params_unenroll_many(self, client: Finch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
client.hris.benefits.individuals.with_raw_response.unenroll_many(
"",
benefit_id="",
)


Expand All @@ -202,15 +202,15 @@ class TestAsyncIndividuals:
@parametrize
async def test_method_enroll_many(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
)
assert_matches_type(AsyncSinglePage[EnrolledIndividual], individual, path=["response"])

@parametrize
async def test_raw_response_enroll_many(self, async_client: AsyncFinch) -> None:
response = await async_client.hris.benefits.individuals.with_raw_response.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
)

Expand All @@ -222,7 +222,7 @@ async def test_raw_response_enroll_many(self, async_client: AsyncFinch) -> None:
@parametrize
async def test_streaming_response_enroll_many(self, async_client: AsyncFinch) -> None:
async with async_client.hris.benefits.individuals.with_streaming_response.enroll_many(
"string",
benefit_id="benefit_id",
individuals=[{}],
) as response:
assert not response.is_closed
Expand All @@ -237,21 +237,21 @@ async def test_streaming_response_enroll_many(self, async_client: AsyncFinch) ->
async def test_path_params_enroll_many(self, async_client: AsyncFinch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
await async_client.hris.benefits.individuals.with_raw_response.enroll_many(
"",
benefit_id="",
individuals=[{}],
)

@parametrize
async def test_method_enrolled_ids(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.enrolled_ids(
"string",
"benefit_id",
)
assert_matches_type(IndividualEnrolledIDsResponse, individual, path=["response"])

@parametrize
async def test_raw_response_enrolled_ids(self, async_client: AsyncFinch) -> None:
response = await async_client.hris.benefits.individuals.with_raw_response.enrolled_ids(
"string",
"benefit_id",
)

assert response.is_closed is True
Expand All @@ -262,7 +262,7 @@ async def test_raw_response_enrolled_ids(self, async_client: AsyncFinch) -> None
@parametrize
async def test_streaming_response_enrolled_ids(self, async_client: AsyncFinch) -> None:
async with async_client.hris.benefits.individuals.with_streaming_response.enrolled_ids(
"string",
"benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -282,22 +282,22 @@ async def test_path_params_enrolled_ids(self, async_client: AsyncFinch) -> None:
@parametrize
async def test_method_retrieve_many_benefits(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
)
assert_matches_type(AsyncSinglePage[IndividualBenefit], individual, path=["response"])

@parametrize
async def test_method_retrieve_many_benefits_with_all_params(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
individual_ids="d675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a",
)
assert_matches_type(AsyncSinglePage[IndividualBenefit], individual, path=["response"])

@parametrize
async def test_raw_response_retrieve_many_benefits(self, async_client: AsyncFinch) -> None:
response = await async_client.hris.benefits.individuals.with_raw_response.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
)

assert response.is_closed is True
Expand All @@ -308,7 +308,7 @@ async def test_raw_response_retrieve_many_benefits(self, async_client: AsyncFinc
@parametrize
async def test_streaming_response_retrieve_many_benefits(self, async_client: AsyncFinch) -> None:
async with async_client.hris.benefits.individuals.with_streaming_response.retrieve_many_benefits(
"string",
benefit_id="benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -322,28 +322,28 @@ async def test_streaming_response_retrieve_many_benefits(self, async_client: Asy
async def test_path_params_retrieve_many_benefits(self, async_client: AsyncFinch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
await async_client.hris.benefits.individuals.with_raw_response.retrieve_many_benefits(
"",
benefit_id="",
)

@parametrize
async def test_method_unenroll_many(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.unenroll_many(
"string",
benefit_id="benefit_id",
)
assert_matches_type(AsyncSinglePage[UnenrolledIndividual], individual, path=["response"])

@parametrize
async def test_method_unenroll_many_with_all_params(self, async_client: AsyncFinch) -> None:
individual = await async_client.hris.benefits.individuals.unenroll_many(
"string",
benefit_id="benefit_id",
individual_ids=["string", "string", "string"],
)
assert_matches_type(AsyncSinglePage[UnenrolledIndividual], individual, path=["response"])

@parametrize
async def test_raw_response_unenroll_many(self, async_client: AsyncFinch) -> None:
response = await async_client.hris.benefits.individuals.with_raw_response.unenroll_many(
"string",
benefit_id="benefit_id",
)

assert response.is_closed is True
Expand All @@ -354,7 +354,7 @@ async def test_raw_response_unenroll_many(self, async_client: AsyncFinch) -> Non
@parametrize
async def test_streaming_response_unenroll_many(self, async_client: AsyncFinch) -> None:
async with async_client.hris.benefits.individuals.with_streaming_response.unenroll_many(
"string",
benefit_id="benefit_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -368,5 +368,5 @@ async def test_streaming_response_unenroll_many(self, async_client: AsyncFinch)
async def test_path_params_unenroll_many(self, async_client: AsyncFinch) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `benefit_id` but received ''"):
await async_client.hris.benefits.individuals.with_raw_response.unenroll_many(
"",
benefit_id="",
)
Loading

0 comments on commit 769559c

Please sign in to comment.