def _create_drift_data(self, region_tags, name=None):
     return pdd.PolyglotDriftData(name=name,
                                  class_name=None,
                                  method_name=None,
                                  source_path='',
                                  start_line=None,
                                  end_line=None,
                                  parser=None,
                                  region_tags=region_tags)
def _create_source_methods_json(region_tag, test_methods):
    return [polyglot_drift_data.PolyglotDriftData(
        # Unused (but non-optional) properties
        # These properties are required outside of tests
        name=None,
        class_name=None,
        method_name=None,
        source_path=None,
        start_line=None,
        end_line=None,
        parser=None,

        # Useful properties
        region_tags=[region_tag],
        test_methods=test_methods
    )]
def _create_fixtures(test_folder, add_main=False):
    test_file = f'{test_folder}_main.py' if add_main else f'{test_folder}.py'

    test_folder_path = path.join(TEST_DATA_PATH, test_folder)
    repo_json = path.join(test_folder_path, 'polyglot_snippet_data.json')
    source_path = path.join(test_folder_path, test_file)

    source_methods_json = _parse_json(repo_json)
    source_methods = [pdd.PolyglotDriftData(**json_dict)
                      for json_dict in source_methods_json]

    source_region_tags = \
        polyglot_parser.get_region_tag_regions(source_path)[0]
    for idx, method in enumerate(source_methods):
        source_methods[idx] = \
            polyglot_parser.add_region_tags_to_method(
                method, source_region_tags
            )

    return source_methods