From b5c1bea18f4e7af5cb7b4b39ec16e09281a486ed Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Mon, 23 Mar 2015 12:23:34 +0200 Subject: [PATCH] Adding inject() decorator tests --- tests/test_injections.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_injections.py b/tests/test_injections.py index 2116fb94..b4d5ff3c 100644 --- a/tests/test_injections.py +++ b/tests/test_injections.py @@ -10,6 +10,8 @@ from objects.injections import inject from objects.providers import NewInstance +from objects.providers import Error + class InjectionTests(unittest.TestCase): @@ -133,3 +135,7 @@ class InjectTests(unittest.TestCase): self.assertIsInstance(b1, list) self.assertIsInstance(b2, list) self.assertIsNot(b1, b2) + + def test_decorate_with_not_injection(self): + """Test `inject()` decorator with not an injection instance.""" + self.assertRaises(Error, inject, object)