Coverage for src/fluree_py/http/protocol/mixin/commit.py: 80%
10 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-02 03:03 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-02 03:03 +0000
1from typing import Protocol
3from fluree_py.http.response import FlureeResponse
6class SupportsCommit(Protocol):
7 """Protocol for objects that support synchronous commit operations."""
9 def commit(self) -> FlureeResponse:
10 """Executes the transaction synchronously.
12 Exceptions:
13 httpx.RequestError: If the HTTP request fails.
14 TypeError: If the type parameter cannot be resolved.
15 """
16 ...
19class SupportsAsyncCommit(Protocol):
20 """Protocol for objects that support asynchronous commit operations."""
22 async def acommit(self) -> FlureeResponse:
23 """Executes the transaction asynchronously.
25 Exceptions:
26 httpx.RequestError: If the HTTP request fails.
27 TypeError: If the type parameter cannot be resolved.
28 """
29 ...
32class SupportsCommitable(SupportsCommit, SupportsAsyncCommit, Protocol):
33 """Protocol for objects that support both sync and async commit operations."""
35 pass