Add stub for the FactoryDelegate

This commit is contained in:
Roman Mogylatov 2020-08-25 20:00:26 -04:00
parent 1c967b74d2
commit 2a609dd54b
2 changed files with 7 additions and 0 deletions

View File

@ -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: ...

View File

@ -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))