def assert_mock_called_once_with_partial(mock, *args, **kwargs):
 assert (len(mock.mock_calls) == 1)
 (m_args, m_kwargs) = mock.call_args
 for (i, arg) in enumerate(args):
  assert (m_args[i] == arg)
 for kwarg in kwargs:
  assert (m_kwargs[kwarg] == kwargs[kwarg])

def assert_mock_called_once_with_partial ( mock , * args , ** kwargs ) : assert ( len ( mock . mock_calls ) == 1 ) ( m_args , m_kwargs ) = mock . call_args for ( i , arg ) in enumerate ( args ) : assert ( m_args [ i ] == arg ) for kwarg in kwargs : assert ( m_kwargs [ kwarg ] == kwargs [ kwarg ] )
similar to mock .