1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
8 # NOTE: Migration 20190322174136_add_file_info_to_collection.rb
9 # relies on this test. Change with caution!
10 class GroupPdhsTest < ActiveSupport::TestCase
11 test "pdh_grouping_by_manifest_size" do
13 pdhs_in = ['x1+30', 'x2+30', 'x3+201', 'x4+100', 'x5+100']
14 pdh_lambda = lambda { |last_pdh, &block|
15 pdhs = pdhs_in.select{|pdh| pdh > last_pdh}
21 GroupPdhs.group_pdhs_for_multiple_transactions(pdh_lambda, pdhs_in.size, batch_size_max, "") do |pdhs|
24 expected = [['x1+30', 'x2+30'], ['x3+201'], ['x4+100', 'x5+100']]
25 assert_equal(batched_pdhs, expected)