mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-06 13:23:15 +03:00
Add extra tests
This commit is contained in:
parent
90b538952f
commit
93ad687307
|
@ -1,5 +1,6 @@
|
|||
"""Test module for wiring."""
|
||||
|
||||
from decimal import Decimal
|
||||
from typing import Callable
|
||||
|
||||
from dependency_injector.wiring import Provide, Provider
|
||||
|
@ -26,5 +27,6 @@ def test_function_provider(service_provider: Callable[..., Service] = Provider[C
|
|||
def test_config_value(
|
||||
some_value_int: int = Provide[Container.config.a.b.c],
|
||||
some_value_str: str = Provide[Container.config.a.b.c],
|
||||
some_value_decimal: Decimal = Provide[Container.config.a.b.c],
|
||||
):
|
||||
return some_value_int, some_value_str
|
||||
return some_value_int, some_value_str, some_value_decimal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from decimal import Decimal
|
||||
import unittest
|
||||
|
||||
|
||||
from . import module, package
|
||||
from .service import Service
|
||||
from .container import Container
|
||||
|
@ -54,6 +54,7 @@ class WiringTest(unittest.TestCase):
|
|||
self.assertIs(service, test_service)
|
||||
|
||||
def test_configuration_option(self):
|
||||
int_value, str_value = module.test_config_value()
|
||||
int_value, str_value, decimal_value = module.test_config_value()
|
||||
self.assertEqual(int_value, 10)
|
||||
self.assertEqual(str_value, '10')
|
||||
self.assertEqual(decimal_value, Decimal(10))
|
||||
|
|
Loading…
Reference in New Issue
Block a user