mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 01:26:51 +03:00
chore: fix tests
This commit is contained in:
parent
fc4998b86d
commit
68be7ec3b1
|
@ -34,10 +34,7 @@ kwargs4: Dict[str, Any] = provider4.kwargs
|
|||
|
||||
# Test 5: to check the provided instance interface
|
||||
provider5 = providers.Callable(Animal)
|
||||
provided5: providers.ProvidedInstance = provider5.provided
|
||||
attr_getter5: providers.AttributeGetter = provider5.provided.attr
|
||||
item_getter5: providers.ItemGetter = provider5.provided["item"]
|
||||
method_caller: providers.MethodCaller = provider5.provided.method.call(123, arg=324)
|
||||
provided5: Animal = provider5.provided
|
||||
|
||||
# Test 6: to check the DelegatedCallable
|
||||
provider6 = providers.DelegatedCallable(Cat)
|
||||
|
|
|
@ -34,7 +34,7 @@ provider5 = providers.Dict(
|
|||
a1=providers.Factory(object),
|
||||
a2=providers.Factory(object),
|
||||
)
|
||||
provided5: providers.ProvidedInstance = provider5.provided
|
||||
provided5: dict[Any, Any] = provider5.provided
|
||||
|
||||
|
||||
# Test 6: to check the return type with await
|
||||
|
|
|
@ -37,10 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
|
|||
|
||||
# Test 5: to check the provided instance interface
|
||||
provider5 = providers.Factory(Animal)
|
||||
provided5: providers.ProvidedInstance = provider5.provided
|
||||
attr_getter5: providers.AttributeGetter = provider5.provided.attr
|
||||
item_getter5: providers.ItemGetter = provider5.provided["item"]
|
||||
method_caller5: providers.MethodCaller = provider5.provided.method.call(123, arg=324)
|
||||
provided5: Animal = provider5.provided
|
||||
|
||||
# Test 6: to check the DelegatedFactory
|
||||
provider6 = providers.DelegatedFactory(Cat)
|
||||
|
|
|
@ -23,10 +23,7 @@ provider3 = providers.List(
|
|||
providers.Factory(object),
|
||||
providers.Factory(object),
|
||||
)
|
||||
provided3: providers.ProvidedInstance = provider3.provided
|
||||
attr_getter3: providers.AttributeGetter = provider3.provided.attr
|
||||
item_getter3: providers.ItemGetter = provider3.provided["item"]
|
||||
method_caller3: providers.MethodCaller = provider3.provided.method.call(123, arg=324)
|
||||
provided3: List[Any] = provider3.provided
|
||||
|
||||
# Test 4: to check the return type with await
|
||||
provider4 = providers.List(
|
||||
|
|
|
@ -9,10 +9,7 @@ var1: int = provider1()
|
|||
|
||||
# Test 2: to check the provided instance interface
|
||||
provider2 = providers.Object(int)
|
||||
provided2: providers.ProvidedInstance = provider2.provided
|
||||
attr_getter2: providers.AttributeGetter = provider2.provided.attr
|
||||
item_getter2: providers.ItemGetter = provider2.provided["item"]
|
||||
method_caller2: providers.MethodCaller = provider2.provided.method.call(123, arg=324)
|
||||
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: providers.ProvidedInstance = provider1.provided
|
||||
provided: int = provider1.provided
|
||||
|
||||
# Test 2: to check async mode API
|
||||
provider2: providers.Provider = providers.Provider()
|
||||
|
|
|
@ -37,10 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
|
|||
|
||||
# Test 5: to check the provided instance interface
|
||||
provider5 = providers.Singleton(Animal)
|
||||
provided5: providers.ProvidedInstance = provider5.provided
|
||||
attr_getter5: providers.AttributeGetter = provider5.provided.attr
|
||||
item_getter5: providers.ItemGetter = provider5.provided["item"]
|
||||
method_caller5: providers.MethodCaller = provider5.provided.method.call(123, arg=324)
|
||||
provided5: Animal = provider5.provided
|
||||
|
||||
# Test 6: to check the DelegatedSingleton
|
||||
provider6 = providers.DelegatedSingleton(Cat)
|
||||
|
|
Loading…
Reference in New Issue
Block a user