mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-08 22:33:15 +03:00
Add stub for the FactoryDelegate
This commit is contained in:
parent
1c967b74d2
commit
2a609dd54b
|
@ -184,6 +184,10 @@ class AbstractFactory(Factory):
|
|||
def override(self, provider: Factory) -> OverridingContext: ...
|
||||
|
||||
|
||||
class FactoryDelegate(Delegate):
|
||||
def __init__(self, factory: Factory): ...
|
||||
|
||||
|
||||
class ProvidedInstanceFluentInterface:
|
||||
def __getattr__(self, item: str) -> AttributeGetter: ...
|
||||
def __getitem__(self, item: str) -> ItemGetter: ...
|
||||
|
|
|
@ -50,3 +50,6 @@ animal6: Animal = provider6(1, 2, 3, b='1', c=2, e=0.0)
|
|||
provider7 = providers.AbstractFactory(Animal)
|
||||
provider7.override(providers.Factory(Cat))
|
||||
animal7: Animal = provider7(1, 2, 3, b='1', c=2, e=0.0)
|
||||
|
||||
# Test 8: to check the FactoryDelegate __init__
|
||||
provider8 = providers.FactoryDelegate(providers.Factory(object))
|
||||
|
|
Loading…
Reference in New Issue
Block a user