mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-04-13 05:34:23 +03:00
fix: typing tests
This commit is contained in:
parent
839de5d527
commit
185a491521
|
@ -34,7 +34,7 @@ provider5 = providers.Dict(
|
|||
a1=providers.Factory(object),
|
||||
a2=providers.Factory(object),
|
||||
)
|
||||
provided5: dict[Any, Any] = provider5.provided
|
||||
provided5: dict[Any, Any] = provider5.provided()
|
||||
|
||||
|
||||
# Test 6: to check the return type with await
|
||||
|
|
|
@ -37,7 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
|
|||
|
||||
# Test 5: to check the provided instance interface
|
||||
provider5 = providers.Factory(Animal)
|
||||
provided5: Animal = provider5.provided
|
||||
provided5: Animal = provider5.provided()
|
||||
|
||||
# Test 6: to check the DelegatedFactory
|
||||
provider6 = providers.DelegatedFactory(Cat)
|
||||
|
|
|
@ -23,7 +23,7 @@ provider3 = providers.List(
|
|||
providers.Factory(object),
|
||||
providers.Factory(object),
|
||||
)
|
||||
provided3: List[Any] = provider3.provided
|
||||
provided3: List[Any] = provider3.provided()
|
||||
|
||||
# Test 4: to check the return type with await
|
||||
provider4 = providers.List(
|
||||
|
|
|
@ -9,7 +9,7 @@ var1: int = provider1()
|
|||
|
||||
# Test 2: to check the provided instance interface
|
||||
provider2 = providers.Object(int)
|
||||
provided2: Type[int] = provider2.provided
|
||||
provided2: Type[int] = provider2.provided()
|
||||
|
||||
# Test 3: to check the return type with await
|
||||
provider3 = providers.Object(int(3))
|
||||
|
|
|
@ -3,7 +3,7 @@ from dependency_injector import providers
|
|||
|
||||
# Test 1: to check .provided attribute
|
||||
provider1: providers.Provider[int] = providers.Object(1)
|
||||
provided: int = provider1.provided
|
||||
provided: int = provider1.provided()
|
||||
|
||||
# Test 2: to check async mode API
|
||||
provider2: providers.Provider = providers.Provider()
|
||||
|
|
|
@ -37,7 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
|
|||
|
||||
# Test 5: to check the provided instance interface
|
||||
provider5 = providers.Singleton(Animal)
|
||||
provided5: Animal = provider5.provided
|
||||
provided5: Animal = provider5.provided()
|
||||
|
||||
# Test 6: to check the DelegatedSingleton
|
||||
provider6 = providers.DelegatedSingleton(Cat)
|
||||
|
|
Loading…
Reference in New Issue
Block a user