Skip to content

Commit

Permalink
detect hidden flag updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jayamala17 committed Aug 6, 2024
1 parent 1ae573f commit 29920c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/test_bag_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ def test_check_if_valid_when_hidden_file_not_in_manifest_and_detect_hidden_true
bag = BagAdapter::BagAdapter.new(target_dir: @test_dir_path, detect_hidden: true)
result = bag.check_if_valid
refute result.is_valid
assert result.error_message.length > 0
assert result.error_message
end

def test_check_if_valid_when_hidden_file_in_manifest_and_detect_hidden_false
create_bag_with_hidden_file_in_manifest
bag = BagAdapter::BagAdapter.new(target_dir: @test_dir_path, detect_hidden: false)
result = bag.check_if_valid
refute result.is_valid
assert result.error_message.length > 0
assert result.error_message
end

def test_check_if_valid_when_hidden_file_not_in_manifest_and_detect_hidden_false
Expand Down
8 changes: 4 additions & 4 deletions test/test_bag_courier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def create_courier(
end

def test_deliver_with_dry_run_false
courier = create_courier(dry_run: false, target_client: @mock_target_client, detect_hidden: false)
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, 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, target_client: @mock_target_client, detect_hidden: false)
courier = create_courier(dry_run: true, detect_hidden: @detect_hidden, 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, target_client: @aptrust_target_client, detect_hidden: false)
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, 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, target_client: @mock_target_client, remove_export: true, detect_hidden: false)
courier = create_courier(dry_run: false, detect_hidden: @detect_hidden, 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

0 comments on commit 29920c0

Please sign in to comment.