Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-python"
---

Add test cases for float duration encode scenarios in query and header params, covering `float_milliseconds`, `float64_milliseconds`, `float_seconds_larger_unit`, and `float_milliseconds_larger_unit` with whole-number float values (e.g. `35625.0`) that require numeric comparison.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ async def test_query(client: DurationClient):
await client.query.int32_seconds_array(input=[36, 47])
await client.query.float_seconds(input=35.625)
await client.query.float64_seconds(input=35.625)
await client.query.float_milliseconds(input=35625.0)
await client.query.float64_milliseconds(input=35625.0)
await client.query.float_seconds_larger_unit(input=150.0)
await client.query.float_milliseconds_larger_unit(input=210000.0)


@pytest.mark.asyncio
Expand Down Expand Up @@ -61,3 +65,7 @@ async def test_header(client: DurationClient):
await client.header.int32_seconds(duration=36)
await client.header.float_seconds(duration=35.625)
await client.header.float64_seconds(duration=35.625)
await client.header.float_milliseconds(duration=35625.0)
await client.header.float64_milliseconds(duration=35625.0)
await client.header.float_seconds_larger_unit(duration=150.0)
await client.header.float_milliseconds_larger_unit(duration=210000.0)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def test_query(client: DurationClient):
client.query.int32_seconds_array(input=[36, 47])
client.query.float_seconds(input=35.625)
client.query.float64_seconds(input=35.625)
client.query.float_milliseconds(input=35625.0)
client.query.float64_milliseconds(input=35625.0)
client.query.float_seconds_larger_unit(input=150.0)
client.query.float_milliseconds_larger_unit(input=210000.0)


def test_property(client: DurationClient):
Expand Down Expand Up @@ -58,3 +62,7 @@ def test_header(client: DurationClient):
client.header.int32_seconds(duration=36)
client.header.float_seconds(duration=35.625)
client.header.float64_seconds(duration=35.625)
client.header.float_milliseconds(duration=35625.0)
client.header.float64_milliseconds(duration=35625.0)
client.header.float_seconds_larger_unit(duration=150.0)
client.header.float_milliseconds_larger_unit(duration=210000.0)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ async def test_query(client: DurationClient):
await client.query.int32_seconds_array(input=[36, 47])
await client.query.float_seconds(input=35.625)
await client.query.float64_seconds(input=35.625)
await client.query.float_milliseconds(input=35625.0)
await client.query.float64_milliseconds(input=35625.0)
await client.query.float_seconds_larger_unit(input=150.0)
await client.query.float_milliseconds_larger_unit(input=210000.0)


@pytest.mark.asyncio
Expand Down Expand Up @@ -61,3 +65,7 @@ async def test_header(client: DurationClient):
await client.header.int32_seconds(duration=36)
await client.header.float_seconds(duration=35.625)
await client.header.float64_seconds(duration=35.625)
await client.header.float_milliseconds(duration=35625.0)
await client.header.float64_milliseconds(duration=35625.0)
await client.header.float_seconds_larger_unit(duration=150.0)
await client.header.float_milliseconds_larger_unit(duration=210000.0)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def test_query(client: DurationClient):
client.query.int32_seconds_array(input=[36, 47])
client.query.float_seconds(input=35.625)
client.query.float64_seconds(input=35.625)
client.query.float_milliseconds(input=35625.0)
client.query.float64_milliseconds(input=35625.0)
client.query.float_seconds_larger_unit(input=150.0)
client.query.float_milliseconds_larger_unit(input=210000.0)


def test_property(client: DurationClient):
Expand Down Expand Up @@ -58,3 +62,7 @@ def test_header(client: DurationClient):
client.header.int32_seconds(duration=36)
client.header.float_seconds(duration=35.625)
client.header.float64_seconds(duration=35.625)
client.header.float_milliseconds(duration=35625.0)
client.header.float64_milliseconds(duration=35625.0)
client.header.float_seconds_larger_unit(duration=150.0)
client.header.float_milliseconds_larger_unit(duration=210000.0)
22 changes: 11 additions & 11 deletions packages/http-client-python/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/http-client-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@typespec/sse": "~0.79.0",
"@typespec/streams": "~0.79.0",
"@typespec/xml": "~0.79.0",
"@typespec/http-specs": "0.1.0-alpha.33-dev.2",
"@typespec/http-specs": "0.1.0-alpha.33-dev.6",
"@types/js-yaml": "~4.0.5",
"@types/node": "~25.0.2",
"@types/semver": "7.5.8",
Expand Down
Loading