Skip to content

Commit

Permalink
removed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jayamala17 committed May 7, 2024
1 parent 1152a69 commit b54d0f1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions test/test_jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,4 @@ def test_set_processing_duration
assert_equal(expect_duration, actual_duration)
end
end

def test_get_failed_bag_ids
failed_status = [BagStatus::DEPOSIT_SKIPPED, BagStatus::FAILED, BagStatus::VALIDATION_SKIPPED, BagStatus::VERIFY_FAILED]

bag_mock = Minitest::Mock.new
bag_mock.expect(:join, bag_mock,[:status_event, Sequel.qualify(:status_event, :bag_id) => Sequel.qualify(:bag, :id)])
bag_mock.expect(:join, bag_mock, [:status, Sequel.qualify(:status, :id) => Sequel.qualify(:status_event, :status_id)])
bag_mock.expect(:where, bag_mock, [Sequel.qualify(:status_event, :timestamp) >= @start_time])
bag_mock.expect(:where, bag_mock, [Sequel.qualify(:status, :name).like("%#{failed_status.join('%')}%")])
bag_mock.expect(:group, bag_mock, [Sequel[:bag][:identifier]])
bag_mock.expect(:select_map, ['4355a','hgfb5'], Sequel[:bag][:identifier])

DatabaseSchema::Bag.stub(:call, bag_mock) do
failed_bag_ids = @metrics.get_failed_bag_ids
expected_bag_ids = ['4355a','hgfb5']
assert_equal expected_bag_ids, failed_bag_ids
end
end
end

0 comments on commit b54d0f1

Please sign in to comment.