Skip to content

Commit

Permalink
chore(internal): fix path params tests (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 31, 2025
1 parent 2da97d0 commit 167cc87
Show file tree
Hide file tree
Showing 26 changed files with 868 additions and 868 deletions.
16 changes: 8 additions & 8 deletions tests/api_resources/dns/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="HTTP 422 from prism")
@parametrize
def test_path_params_edit(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.dns.settings.with_raw_response.edit(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.dns.settings.with_raw_response.edit(
account_id="account_id",
)
Expand Down Expand Up @@ -136,12 +136,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="HTTP 422 from prism")
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.dns.settings.with_raw_response.get(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.dns.settings.with_raw_response.get(
account_id="account_id",
)
Expand Down Expand Up @@ -214,12 +214,12 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip(reason="HTTP 422 from prism")
@parametrize
async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.dns.settings.with_raw_response.edit(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.dns.settings.with_raw_response.edit(
account_id="account_id",
)
Expand Down Expand Up @@ -269,12 +269,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip(reason="HTTP 422 from prism")
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.dns.settings.with_raw_response.get(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.dns.settings.with_raw_response.get(
account_id="account_id",
)
52 changes: 26 additions & 26 deletions tests/api_resources/firewall/test_access_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_create(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.create(
configuration={},
mode="block",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.create(
configuration={},
mode="block",
Expand Down Expand Up @@ -151,12 +151,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_list(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.list(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.list(
account_id="account_id",
)
Expand Down Expand Up @@ -210,19 +210,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_delete(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.delete(
rule_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.delete(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.delete(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="account_id",
Expand Down Expand Up @@ -289,23 +289,23 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_edit(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.edit(
rule_id="",
configuration={},
mode="block",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.edit(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
configuration={},
mode="block",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.edit(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
configuration={},
Expand Down Expand Up @@ -362,19 +362,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.get(
rule_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.get(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.firewall.access_rules.with_raw_response.get(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="account_id",
Expand Down Expand Up @@ -441,14 +441,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.create(
configuration={},
mode="block",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.create(
configuration={},
mode="block",
Expand Down Expand Up @@ -511,12 +511,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.list(
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.list(
account_id="account_id",
)
Expand Down Expand Up @@ -570,19 +570,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.delete(
rule_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.delete(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.delete(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="account_id",
Expand Down Expand Up @@ -649,23 +649,23 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.edit(
rule_id="",
configuration={},
mode="block",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.edit(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
configuration={},
mode="block",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.edit(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
configuration={},
Expand Down Expand Up @@ -722,19 +722,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.get(
rule_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.get(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.firewall.access_rules.with_raw_response.get(
rule_id="023e105f4ecef8ad9ca31a8372d0c353",
account_id="account_id",
Expand Down
12 changes: 6 additions & 6 deletions tests/api_resources/logpush/datasets/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
def test_path_params_get(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.logpush.datasets.fields.with_raw_response.get(
dataset_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.logpush.datasets.fields.with_raw_response.get(
dataset_id="gateway_dns",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
client.logpush.datasets.fields.with_raw_response.get(
dataset_id="gateway_dns",
account_id="account_id",
Expand Down Expand Up @@ -136,19 +136,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
@pytest.mark.skip(reason="TODO: investigate broken test")
@parametrize
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.logpush.datasets.fields.with_raw_response.get(
dataset_id="",
account_id="account_id",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.logpush.datasets.fields.with_raw_response.get(
dataset_id="gateway_dns",
account_id="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"):
await async_client.logpush.datasets.fields.with_raw_response.get(
dataset_id="gateway_dns",
account_id="account_id",
Expand Down
Loading

0 comments on commit 167cc87

Please sign in to comment.