@pytest.mark.parametrize('code,call,args', [(codes.SCRAPE, 'scrape', ['http://www.google.com/']), (codes.ANALYZE, 'analyze', ['安全性能很好，很帅气。', ['categories']])])
def test_proper_method_call(api, code, call, args, mocker):
    mock.patch(('anacode.api.client.AnacodeClient.' + call), empty_json)
    mocker.spy(api, call)
    api.call((code, *args))
    getattr(api, call).assert_called_once_with(*args)
@pytest.mark.parametrize('code,call,args', [(codes.SCRAPE, 'scrape', ['http://www.google.com/']), (codes.ANALYZE, 'analyze', ['安全性能很好，很帅气。', ['categories']])])
def test_proper_method_call(api, code, call, args, mocker):
    mock.patch(('anacode.api.client.AnacodeClient.' + call), empty_json)
    mocker.spy(api, call)
    api.call((code, *args))
    getattr(api, call).assert_called_once_with(*args)