예제 #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")
예제 #2
0
    def test_injection_kwargs_only(self):
        injector = Injector(test="A")
        call = injector.wrap(lambda *, test: test + test + test)

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

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

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