<commit_before># encoding: utf-8

require "spec_helper"

describe DpdApi::LabelPrint do

  context "local_labels" do
    let(:single_label) { [ { sender_name: '<NAME>', receiver_name: '<NAME>, 344018, Россия, г. Москва, ул. Верхнаяя масловка, д. 127 к. 2, кв. 26', order_number: 132947, barcode: '2096022', dpd_number: '03046124MOW'} ] }
    let(:multiple_labels) { [ { sender_name: '<NAME>', receiver_name: '<NAME>', order_number: 344019, barcode: '2096022', dpd_number: '03046123MOW'},
                              { sender_name: '<NAME>', receiver_name: '<NAME>, 344018, Россия, г. Москва, ул. Верхнаяя масловка, д. 127 к. 2, кв. 26', order_number: 344020, barcode: '2096022', dpd_number: '03046124MOW'}] }

    it "renders single label" do
      expect do
        w = described_class.create_local_labels(single_label)
        File.open('/home/nu-hin/Desktop/dpd.html', 'w') { |file| file.write(w) }
      end.not_to raise_error
    end

    it "renders multiple labels" do
      expect do
        w = described_class.create_local_labels(multiple_labels)
        File.open('/home/nu-hin/Desktop/dpd_m.html', 'w') { |file| file.write(w) }
      end.not_to raise_error
    end
  end
end<commit_msg>Новый формат ярлыков в тестах<commit_after># encoding: utf-8

require "spec_helper"

describe DpdApi::LabelPrint do

  context "local_labels" do
    let(:labels) { [ { sender_name: '<NAME>', receiver_name: '<NAME>, 344018, Россия, г. Москва, ул. Верхняя масловка, д. 127 к. 2, кв. 26', order_number: 700001, barcode: 'KDL2096022', dpd_number: '03046124MOW'},
                              { sender_name: '<NAME>', receiver_name: '<NAME>, 344108, Россия, г. Ростов-на-Дону, пер. Соборный, д. 61, кв.', order_number: 700002, barcode: 'KDL2096024', dpd_number: '03046123MOW'},
                              { sender_name: '<NAME>', receiver_name: '<NAME>, 344018, Россия, г. Москва, пр-кт. Ленинградский, д. 200 к. 1, кв. 19', order_number: 700003, barcode: 'KDL2096023', dpd_number: '03046124MOW'}] }

    it 'renders single label' do
      labels.each_with_index do |label, i|
        expect do
          w = described_class.create_local_labels([label])
          File.open("/home/nu-hin/Desktop/dpd_#{i}.html", 'w') { |file| file.write(w) }
        end.not_to raise_error
      end
    end

    it 'renders multiple labels' do
      expect do
        w = described_class.create_local_labels(labels)
        File.open('/home/nu-hin/Desktop/dpd_m.html', 'w') { |file| file.write(w) }
      end.not_to raise_error
    end
  end
end
{'fraction_non_alphanumeric': 0.1439873417721519, 'fraction_numerical': 0.07278481012658228, 'mean_word_length': 3.1940298507462686, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '349576', 'n_tokens_mistral': 1053, 'n_tokens_neox': 947, 'n_words': 221}