Skip to content

Commit

Permalink
Set detect_hidden default in create_courier; reorder some more arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ssciolla committed Aug 6, 2024
1 parent 8fad97b commit dc13424
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions test/test_bag_courier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def setup
def create_courier(
dry_run:,
target_client:,
detect_hidden:,
detect_hidden: true,
validator: @validator,
remove_export: false
)
Expand All @@ -135,19 +135,19 @@ def create_courier(
bag_info: @bag_info,
tags: [@aptrust_info],
data_transfer: @data_transfer,
detect_hidden: detect_hidden,
working_dir: @prep_path,
export_dir: @export_path,
remove_export: remove_export,
dry_run: dry_run,
status_event_repo: @status_event_repo,
target_client: target_client,
validator: validator,
detect_hidden: detect_hidden
validator: validator
)
end

def test_deliver_with_dry_run_false
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, target_client: @mock_target_client)
courier = create_courier(dry_run: false, target_client: @mock_target_client)
expected_tar_file_path = File.join(@export_path, @bag_id.to_s + ".tar")
@mock_target_client.expect(:remote_text, "AWS S3 remote location in bucket fake")
@mock_target_client.expect(:send_file, nil, local_file_path: expected_tar_file_path)
Expand All @@ -173,7 +173,7 @@ def test_deliver_with_dry_run_false
end

def test_deliver_with_dry_run
courier = create_courier(dry_run: true, detect_hidden: @detect_hidden, target_client: @mock_target_client)
courier = create_courier(dry_run: true, target_client: @mock_target_client)
courier.deliver
@mock_target_client.verify

Expand All @@ -189,7 +189,7 @@ def test_deliver_with_dry_run
end

def test_deliver_when_deposit_raises_error
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, target_client: @aptrust_target_client)
courier = create_courier(dry_run: false, target_client: @aptrust_target_client)
raise_error = proc { raise RemoteClient::RemoteClientError, "specific details" }
@aptrust_target_client.stub :send_file, raise_error do
courier.deliver
Expand All @@ -203,7 +203,7 @@ def test_deliver_when_deposit_raises_error
end

def test_deliver_with_remove_export
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, target_client: @mock_target_client, remove_export: true)
courier = create_courier(dry_run: false, target_client: @mock_target_client, remove_export: true)
expected_tar_file_path = File.join(@export_path, @bag_id.to_s + ".tar")
@mock_target_client.expect(:remote_text, "AWS S3 remote location in bucket fake")
@mock_target_client.expect(:send_file, nil, local_file_path: expected_tar_file_path)
Expand Down
4 changes: 2 additions & 2 deletions test/test_dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def setup
repository: repository,
context: "some-context",
extra_bag_info_data: {"something_extra" => true},
detect_hidden: @detect_hidden,
target_client: target_client,
bag_repo: BagRepository::BagDatabaseRepository.new,
status_event_repo: StatusEventRepository::StatusEventDatabaseRepository.new,
detect_hidden: @detect_hidden
status_event_repo: StatusEventRepository::StatusEventDatabaseRepository.new
)

@bag_identifier = "some-repo.some-context-00001"
Expand Down

0 comments on commit dc13424

Please sign in to comment.