Adding inject() decorator tests

This commit is contained in:
Roman Mogilatov 2015-03-23 12:23:34 +02:00
parent b0c2005288
commit b5c1bea18f
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,8 @@ from objects.injections import inject
from objects.providers import NewInstance from objects.providers import NewInstance
from objects.providers import Error
class InjectionTests(unittest.TestCase): class InjectionTests(unittest.TestCase):
@ -133,3 +135,7 @@ class InjectTests(unittest.TestCase):
self.assertIsInstance(b1, list) self.assertIsInstance(b1, list)
self.assertIsInstance(b2, list) self.assertIsInstance(b2, list)
self.assertIsNot(b1, b2) self.assertIsNot(b1, b2)
def test_decorate_with_not_injection(self):
"""Test `inject()` decorator with not an injection instance."""
self.assertRaises(Error, inject, object)