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 packages/http/httpx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

The Microsoft Kiota HTTP Library is a python HTTP implementation with HTTPX library.

A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a http package to to make HTTP requests to an API endpoint.
A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a http package to make HTTP requests to an API endpoint.

Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md).

Expand Down
10 changes: 10 additions & 0 deletions packages/http/httpx/kiota_http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
Kiota http request adapter implementation for httpx library
"""
from ._version import VERSION
from .httpx_request_adapter import HttpxRequestAdapter
from .kiota_client_factory import KiotaClientFactory
from .observability_options import ObservabilityOptions

__version__ = VERSION

__all__ = [
Comment thread
baywet marked this conversation as resolved.
"__version__",
"HttpxRequestAdapter",
"KiotaClientFactory",
"ObservabilityOptions",
]
26 changes: 26 additions & 0 deletions packages/http/httpx/tests/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,29 @@ def test_httpx_request_adapter_is_a_request_adapter_of_httpx_request(tmp_path):
)
stdout, _, exit_status = api.run(["--follow-imports=silent", str(snippet)])
assert exit_status == 0, stdout


def test_package_exports():
import kiota_http
assert hasattr(kiota_http, "HttpxRequestAdapter")
assert hasattr(kiota_http, "KiotaClientFactory")
assert hasattr(kiota_http, "ObservabilityOptions")
assert hasattr(kiota_http, "__version__")
assert "HttpxRequestAdapter" in kiota_http.__all__
assert "KiotaClientFactory" in kiota_http.__all__
assert "ObservabilityOptions" in kiota_http.__all__
assert "__version__" in kiota_http.__all__


def test_package_exports_typecheck(tmp_path):
snippet = tmp_path / "snippet.py"
snippet.write_text(
"from kiota_http import (\n"
" HttpxRequestAdapter,\n"
" KiotaClientFactory,\n"
" ObservabilityOptions,\n"
" __version__,\n"
")\n"
)
stdout, _, exit_status = api.run(["--follow-imports=silent", str(snippet)])
assert exit_status == 0, stdout
Loading