<commit_before>require 'rspec'

describe 'Brand test' do
    def to_json(obj)
        puts obj
        {
          api_id: obj.api_id,
          brand: obj.brand
        }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_brand(obj)
     {
     address: obj['address'],
     authorized_contact: obj['authorized_contact'],
     brand_id: obj['brand_id'],
     brand_type: obj['brand_type'],
     ein_issuing_country:obj['ein_issuing_country'],
     registration_status: obj['registration_status'],
     brand_alias: obj['brand_alias'],
     profile_uuid: obj['profile_uuid'],
     vertical: obj['vertical'],
     vetting_score: obj['vetting_score'],
     vetting_status: obj['vetting_status'],
     entity_type: obj['entity_type'],
     ein: obj['ein'],
     website: obj['website'],
     company_name: obj['company_name']

     }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_list(list_object)
        puts list_object
        objects_json = list_object['brands'].map do |object|
            JSON.parse(to_json_brand(object))
          end
          {
            api_id: list_object['api_id'],
            brands: objects_json
          }.to_json
    end
    def to_json_create(obj)
      puts obj
      {
        api_id: obj.api_id,
        brand_id: obj.brand_id,
        message: obj.message
      }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_brand_usecase(obj)
      puts obj
      {
      brand_id: obj.brand_id,
      use_cases: obj.use_cases
      }.reject { |_, v| v.nil? }.to_json
    end
    it 'get brand' do
        contents = File.read(Dir.pwd + '/spec/mocks/brandGetResponse.json')
        mock(200, JSON.parse(contents))
        response = @api.brand<commit_msg>usecase UT<commit_after>require 'rspec'

describe 'Brand test' do
    def to_json(obj)
        puts obj
        {
          api_id: obj.api_id,
          brand: obj.brand
        }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_brand(obj)
     {
     address: obj['address'],
     authorized_contact: obj['authorized_contact'],
     brand_id: obj['brand_id'],
     brand_type: obj['brand_type'],
     ein_issuing_country:obj['ein_issuing_country'],
     registration_status: obj['registration_status'],
     brand_alias: obj['brand_alias'],
     profile_uuid: obj['profile_uuid'],
     vertical: obj['vertical'],
     vetting_score: obj['vetting_score'],
     vetting_status: obj['vetting_status'],
     entity_type: obj['entity_type'],
     ein: obj['ein'],
     website: obj['website'],
     company_name: obj['company_name']

     }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_list(list_object)
        puts list_object
        objects_json = list_object['brands'].map do |object|
            JSON.parse(to_json_brand(object))
          end
          {
            api_id: list_object['api_id'],
            brands: objects_json
          }.to_json
    end
    def to_json_create(obj)
      puts obj
      {
        api_id: obj.api_id,
        brand_id: obj.brand_id,
        message: obj.message
      }.reject { |_, v| v.nil? }.to_json
    end
    def to_json_brand_usecase(obj)
      puts obj
      {
        api_id: obj.api_id,
        brand_id: obj.brand_id,
        use_cases: obj.use_cases
      }.reject { |_, v| v.nil? }.to_json
    end
    it 'get brand' do
        contents = File.read(Dir.pwd + '/spec/mocks/brandGetResponse.json')
        mock(200, JSON.parse(contents))
        response = @api.brand
{'fraction_non_alphanumeric': 0.12496375761090171, 'fraction_numerical': 0.0017396346767178893, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3715634', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1157, 'n_words': 222}