@pytest.mark.parametrize('call, args', [('scrape', ([],)), ('analyze', ([], ['categories'])), ('analyze', ([], ['concepts'])), ('analyze', ([], ['sentiment'])), ('analyze', ([], ['absa']))])
def test_analysis_execution(api, mocker, call, args):
    text = ['安全性能很好，很帅气。']
    writer = writers.DataFrameWriter()
    writer.init()
    to_mock = ('anacode.api.client.AnacodeClient.' + call)
    mock.patch(to_mock, empty_json)
    mocker.spy(api, call)
    analyzer = client.Analyzer(api, writer, bulk_size=10)
    for _ in range(4):
        getattr(analyzer, call)(*args)
    analyzer.execute_tasks_and_store_output()
    assert (getattr(api, call).call_count == 4)
@pytest.mark.parametrize('call, args', [('scrape', ([],)), ('analyze', ([], ['categories'])), ('analyze', ([], ['concepts'])), ('analyze', ([], ['sentiment'])), ('analyze', ([], ['absa']))])
def test_analysis_execution(api, mocker, call, args):
    text = ['安全性能很好，很帅气。']
    writer = writers.DataFrameWriter()
    writer.init()
    to_mock = ('anacode.api.client.AnacodeClient.' + call)
    mock.patch(to_mock, empty_json)
    mocker.spy(api, call)
    analyzer = client.Analyzer(api, writer, bulk_size=10)
    for _ in range(4):
        getattr(analyzer, call)(*args)
    analyzer.execute_tasks_and_store_output()
    assert (getattr(api, call).call_count == 4)