Example #1
0
    def test_argspec_report(self):
        def _test_spec(arg1, arg2, kwarg1=None):
            pass

        sys_mock = create_autospec(_test_spec)
        test_functions = {'test_module.test_spec': sys_mock}
        ret = utils.argspec_report(test_functions, 'test_module.test_spec')
        self.assertDictEqual(ret, {'test_module.test_spec':
                                       {'kwargs': True, 'args': None, 'defaults': None, 'varargs': True}})
Example #2
0
    def test_argspec_report(self):
        def _test_spec(arg1, arg2, kwarg1=None):
            pass

        sys_mock = create_autospec(_test_spec)
        test_functions = {'test_module.test_spec': sys_mock}
        ret = utils.argspec_report(test_functions, 'test_module.test_spec')
        self.assertDictEqual(ret, {'test_module.test_spec':
                                       {'kwargs': True, 'args': None, 'defaults': None, 'varargs': True}})
Example #3
0
    def test_argspec_report(self):
        def _test_spec(arg1, arg2, kwarg1=None):
            pass

        sys_mock = create_autospec(_test_spec)
        test_functions = {"test_module.test_spec": sys_mock}
        ret = utils.argspec_report(test_functions, "test_module.test_spec")
        self.assertDictEqual(
            ret, {"test_module.test_spec": {"kwargs": True, "args": None, "defaults": None, "varargs": True}}
        )
 def setUp(self):
     self.instance = create_autospec(etcd_util.EtcdClient)
     self.EtcdClientMock = MagicMock()
     self.EtcdClientMock.return_value = self.instance
Example #5
0
 def setUp(self):
     self.instance = create_autospec(etcd_util.EtcdClient)
     self.EtcdClientMock = MagicMock()
     self.EtcdClientMock.return_value = self.instance