Пример #1
0
    def test_args_and_kwargs(self):
        def func():
            pass

        emsg = (
            "Invalid lenient client, got both arguments and keyword arguments")
        with self.assertRaisesRegex(AssertionError, emsg):
            _lenient_client(func, services=func)
Пример #2
0
    def test_call_no_kwargs_alternative(self):
        def myclient():
            return _LENIENT.__dict__.copy()

        result = (_lenient_client())(myclient)()
        self.assertIn(self.active, result)
        qualname_client = self.client.format("test_call_no_kwargs_alternative")
        self.assertEqual(result[self.active], qualname_client)
        self.assertNotIn(qualname_client, result)
Пример #3
0
 def test_args_not_callable(self):
     emsg = "Invalid lenient client argument, expecting a callable"
     with self.assertRaisesRegex(AssertionError, emsg):
         _lenient_client(None)
Пример #4
0
 def test_args_too_many(self):
     emsg = "Invalid lenient client arguments, expecting 1"
     with self.assertRaisesRegex(AssertionError, emsg):
         _lenient_client(None, None)