@pytest.mark.parametrize('query_results, results_count', [([], 0), (MOCK_QUERY_RESULTS, len(MOCK_QUERY_RESULTS)), (MOCK_QUERY_RESULTS[:2], 2)])
def test_formats_count(app_instance, mocker, query_results, results_count):
    'Test that results match high-level expectations.'
    query = mocker.patch('AIPscan.Data.report_data._formats_count_query')
    query.return_value = query_results
    get_ss = mocker.patch('AIPscan.Data._get_storage_service')
    get_ss.return_value = MOCK_STORAGE_SERVICE
    test_location = create_test_storage_location()
    get_location = mocker.patch('AIPscan.Data._get_storage_location')
    get_location.return_value = test_location
    report = report_data.formats_count(storage_service_id=MOCK_STORAGE_SERVICE_ID, start_date=datetime.min, end_date=datetime.max, storage_location_id=test_location.id)
    assert (report[fields.FIELD_STORAGE_NAME] == MOCK_STORAGE_SERVICE_NAME)
    assert (report[fields.FIELD_STORAGE_LOCATION] == test_location.description)
    assert (len(report[fields.FIELD_FORMATS]) == results_count)
Test that results match high-level expectations.
@pytest.mark.parametrize('query_results, results_count', [([], 0), (MOCK_QUERY_RESULTS, len(MOCK_QUERY_RESULTS)), (MOCK_QUERY_RESULTS[:2], 2)])
def test_formats_count(app_instance, mocker, query_results, results_count):
    
    query = mocker.patch('AIPscan.Data.report_data._formats_count_query')
    query.return_value = query_results
    get_ss = mocker.patch('AIPscan.Data._get_storage_service')
    get_ss.return_value = MOCK_STORAGE_SERVICE
    test_location = create_test_storage_location()
    get_location = mocker.patch('AIPscan.Data._get_storage_location')
    get_location.return_value = test_location
    report = report_data.formats_count(storage_service_id=MOCK_STORAGE_SERVICE_ID, start_date=datetime.min, end_date=datetime.max, storage_location_id=test_location.id)
    assert (report[fields.FIELD_STORAGE_NAME] == MOCK_STORAGE_SERVICE_NAME)
    assert (report[fields.FIELD_STORAGE_LOCATION] == test_location.description)
    assert (len(report[fields.FIELD_FORMATS]) == results_count)