<commit_before># frozen_string_literal: true

require 'integration_helper'
require 'mws/orders'

class TestOrders < IntegrationTest
  def test_gets_orders
    clients.each do |client|
      order_ids = client.list_orders(client.marketplace.id,
                                     created_after: Date.new(2015),
                                     max_results_per_page: 5)
                        .dig('Orders', 'Order')
                        .map { |order| order['AmazonOrderId'] }

      next if order_ids.count < 2

      orders = client.get_order(*order_ids)
                     .dig('Orders', 'Order')

      assert_equal order_ids.count, orders.count
    end
  end

  def test_gets_service_status
    clients.each do |client|
      res = client.get_service_status
      refute_empty res.parse
    end
  end
end<commit_msg>Break into two lines for easier debugging<commit_after># frozen_string_literal: true

require 'integration_helper'
require 'mws/orders'

class TestOrders < IntegrationTest
  def test_gets_orders
    clients.each do |client|
      order_ids = client.list_orders(client.marketplace.id,
                                     created_after: Date.new(2015),
                                     max_results_per_page: 5)
                        .dig('Orders', 'Order')
                        .map { |order| order['AmazonOrderId'] }

      next if order_ids.count < 2

      res = client.get_order(*order_ids)
      orders = res.dig('Orders', 'Order')

      assert_equal order_ids.count, orders.count
    end
  end

  def test_gets_service_status
    clients.each do |client|
      res = client.get_service_status
      refute_empty res.parse
    end
  end
end
{'fraction_non_alphanumeric': 0.08125741399762752, 'fraction_numerical': 0.0071174377224199285, 'mean_word_length': 2.0232974910394264, 'pattern_counts': {'":': 0, '<': 7, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792450', 'n_tokens_mistral': 508, 'n_tokens_neox': 477, 'n_words': 108}