def _run_avro_test(self, pattern, desired_bundle_size, perform_splitting, expected_result):
    source = _create_avro_source(pattern, use_fastavro=self.use_fastavro)
    if perform_splitting:
        assert desired_bundle_size
        splits = [split for split in source.split(desired_bundle_size=desired_bundle_size)]
        if (len(splits) < 2):
            raise ValueError('Test is trivial. Please adjust it so that at least two splits get generated')
        sources_info = [(split.source, split.start_position, split.stop_position) for split in splits]
        source_test_utils.assert_sources_equal_reference_source((source, None, None), sources_info)
    else:
        read_records = source_test_utils.read_from_source(source, None, None)
        self.assertCountEqual(expected_result, read_records)
def _run_avro_test(self, pattern, desired_bundle_size, perform_splitting, expected_result):
    source = _create_avro_source(pattern, use_fastavro=self.use_fastavro)
    if perform_splitting:
        assert desired_bundle_size
        splits = [split for split in source.split(desired_bundle_size=desired_bundle_size)]
        if (len(splits) < 2):
            raise ValueError('Test is trivial. Please adjust it so that at least two splits get generated')
        sources_info = [(split.source, split.start_position, split.stop_position) for split in splits]
        source_test_utils.assert_sources_equal_reference_source((source, None, None), sources_info)
    else:
        read_records = source_test_utils.read_from_source(source, None, None)
        self.assertCountEqual(expected_result, read_records)