Exemple #1
0
    def test_no_injection(self):
        injector = Injector(test="A")
        call = injector.wrap(lambda test: test + test + test)

        self.assertEqual(call(test="B"), "BBB")
    def test_injection_kwargs_only(self):
        injector = Injector(test="A")
        call = injector.wrap(lambda *, test: test + test + test)

        self.assertEqual(call(), "AAA")
Exemple #3
0
    def test_injection_kwargs_only(self):
        injector = Injector(test="A")
        call = injector.wrap(lambda *, test: test + test + test)

        self.assertEqual(call(), "AAA")
    def test_injection(self):
        injector = Injector(test="A")
        call = injector.wrap(lambda test: test + test + test)

        self.assertEqual(call(), "AAA")