chore: fix tests

This commit is contained in:
Philip Bjorge 2023-08-02 17:31:20 -07:00
parent fc4998b86d
commit 68be7ec3b1
7 changed files with 7 additions and 22 deletions

View File

@ -34,10 +34,7 @@ kwargs4: Dict[str, Any] = provider4.kwargs
# Test 5: to check the provided instance interface # Test 5: to check the provided instance interface
provider5 = providers.Callable(Animal) provider5 = providers.Callable(Animal)
provided5: providers.ProvidedInstance = provider5.provided provided5: Animal = 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)
# Test 6: to check the DelegatedCallable # Test 6: to check the DelegatedCallable
provider6 = providers.DelegatedCallable(Cat) provider6 = providers.DelegatedCallable(Cat)

View File

@ -34,7 +34,7 @@ provider5 = providers.Dict(
a1=providers.Factory(object), a1=providers.Factory(object),
a2=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 # Test 6: to check the return type with await

View File

@ -37,10 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
# Test 5: to check the provided instance interface # Test 5: to check the provided instance interface
provider5 = providers.Factory(Animal) provider5 = providers.Factory(Animal)
provided5: providers.ProvidedInstance = provider5.provided provided5: Animal = 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)
# Test 6: to check the DelegatedFactory # Test 6: to check the DelegatedFactory
provider6 = providers.DelegatedFactory(Cat) provider6 = providers.DelegatedFactory(Cat)

View File

@ -23,10 +23,7 @@ provider3 = providers.List(
providers.Factory(object), providers.Factory(object),
providers.Factory(object), providers.Factory(object),
) )
provided3: providers.ProvidedInstance = provider3.provided provided3: List[Any] = 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)
# Test 4: to check the return type with await # Test 4: to check the return type with await
provider4 = providers.List( provider4 = providers.List(

View File

@ -9,10 +9,7 @@ var1: int = provider1()
# Test 2: to check the provided instance interface # Test 2: to check the provided instance interface
provider2 = providers.Object(int) provider2 = providers.Object(int)
provided2: providers.ProvidedInstance = provider2.provided provided2: Type[int] = 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)
# Test 3: to check the return type with await # Test 3: to check the return type with await
provider3 = providers.Object(int(3)) provider3 = providers.Object(int(3))

View File

@ -3,7 +3,7 @@ from dependency_injector import providers
# Test 1: to check .provided attribute # Test 1: to check .provided attribute
provider1: providers.Provider[int] = providers.Object(1) provider1: providers.Provider[int] = providers.Object(1)
provided: providers.ProvidedInstance = provider1.provided provided: int = provider1.provided
# Test 2: to check async mode API # Test 2: to check async mode API
provider2: providers.Provider = providers.Provider() provider2: providers.Provider = providers.Provider()

View File

@ -37,10 +37,7 @@ attributes4: Dict[str, Any] = provider4.attributes
# Test 5: to check the provided instance interface # Test 5: to check the provided instance interface
provider5 = providers.Singleton(Animal) provider5 = providers.Singleton(Animal)
provided5: providers.ProvidedInstance = provider5.provided provided5: Animal = 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)
# Test 6: to check the DelegatedSingleton # Test 6: to check the DelegatedSingleton
provider6 = providers.DelegatedSingleton(Cat) provider6 = providers.DelegatedSingleton(Cat)