def test_function(self):

    def f(a, b):
        pass
    mock = create_autospec(f)
    self.assertRaises(TypeError, mock)
    mock(1, 2)
    mock.assert_called_with(1, 2)
    mock.assert_called_with(1, b=2)
    mock.assert_called_with(a=1, b=2)
    f.f = f
    mock = create_autospec(f)
    self.assertRaises(TypeError, mock.f)
    mock.f(3, 4)
    mock.f.assert_called_with(3, 4)
    mock.f.assert_called_with(a=3, b=4)
def test_function(self):

    def f(a, b):
        pass
    mock = create_autospec(f)
    self.assertRaises(TypeError, mock)
    mock(1, 2)
    mock.assert_called_with(1, 2)
    mock.assert_called_with(1, b=2)
    mock.assert_called_with(a=1, b=2)
    f.f = f
    mock = create_autospec(f)
    self.assertRaises(TypeError, mock.f)
    mock.f(3, 4)
    mock.f.assert_called_with(3, 4)
    mock.f.assert_called_with(a=3, b=4)