<commit_before>module MiqAeDatastoreConverter
  include MiqAeDatastore
  describe "XML2YAML Converter" do
    before(:each) do
      MiqAeDatastore.reset
      EvmSpecHelper.local_guid_miq_server_zone
    end

    after(:each) do
      MiqAeDatastore.reset
    end
    def setup_export_dir
      @domain     = 'TEST'
      @export_dir = File.join(Dir.tmpdir, "rspec_export_tests")
      @zip_file   = File.join(Dir.tmpdir, "yaml_model.zip")
      FileUtils.rm_rf(@export_dir) if File.exist?(@export_dir)
      FileUtils.rm_rf(@zip_file)   if File.exist?(@zip_file)
    end

    context "convert xml to yaml" do
      before(:each) do
        setup_export_dir
        MiqAeDatastore.reset
        @root_xml = <<-'XML'
        <MiqAeDatastore version='1.0'>
          <MiqAeClass name="AUTOMATE" namespace="evm">
            <MiqAeSchema>
              <MiqAeField name="overlay_method"  aetype="method" display_name="overlay method" />
              <MiqAeField name="attr1"    aetype="attribute" default_value=""  display_name="Attribute1"/>
              <MiqAeField name="connect_to"    aetype="relationship" default_value=""  display_name="Relationship"/>
            </MiqAeSchema><commit_msg>Make a temporary directory for converter spec<commit_after>module MiqAeDatastoreConverter
  include MiqAeDatastore
  describe "XML2YAML Converter" do
    before(:each) do
      MiqAeDatastore.reset
      EvmSpecHelper.local_guid_miq_server_zone
    end

    after(:each) do
      MiqAeDatastore.reset
    end
    def setup_export_dir
      @domain     = 'TEST'
      @export_dir = File.join(Dir.mktmpdir, "rspec_export_tests")
      @zip_file   = File.join(Dir.mktmpdir, "yaml_model.zip")
      FileUtils.rm_rf(@export_dir) if File.exist?(@export_dir)
      FileUtils.rm_rf(@zip_file)   if File.exist?(@zip_file)
    end

    context "convert xml to yaml" do
      before(:each) do
        setup_export_dir
        MiqAeDatastore.reset
        @root_xml = <<-'XML'
        <MiqAeDatastore version='1.0'>
          <MiqAeClass name="AUTOMATE" namespace="evm">
            <MiqAeSchema>
              <MiqAeField name="overlay_method"  aetype="method" display_name="overlay method" />
              <MiqAeField name="attr1"    aetype="attribute" default_value=""  display_name="Attribute1"/>
              <MiqAeField name="connect_to"    aetype="relationship" default_value=""  display_name="Relationship"/>
            </MiqAeSchema>
{'fraction_non_alphanumeric': 0.10617283950617284, 'fraction_numerical': 0.00411522633744856, 'mean_word_length': 2.9528455284552844, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5554554', 'n_tokens_mistral': 835, 'n_tokens_neox': 815, 'n_words': 141}