Branch Coverage

blib/lib/Backblaze/B2V2Client.pm
Criterion Covered Total %
branch 15 84 17.8


line true false branch
26 0 1 unless ($application_key_id and $application_key)
62 1 0 if ($self->{'current_status'} eq 'OK') { }
87 0 1 unless ($file_id)
102 0 1 if ($self->{'current_status'} eq 'OK' and $save_to_location)
116 0 0 unless ($bucket_name and $file_name)
132 0 0 if ($self->{'current_status'} eq 'OK' and $save_to_location)
147 0 0 unless ($save_to_location and -d "$save_to_location")
153 0 0 unless ($self->{'b2_response'}{'X-Bz-File-Name'} and length $self->{'b2_response'}{'file_contents'})
180 0 0 if ($args{'file_location'} and -e "$args{'file_location'}")
188 0 0 unless (length $args{'file_contents'})
194 0 0 unless ($args{'bucket_name'} and $args{'new_file_name'})
229 0 0 unless ($bucket_name)
240 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
254 0 0 if ($self->{'current_status'} eq 'OK')
287 0 0 if ($self->{'current_status'} eq 'OK')
299 0 0 if ($bucket_name and not $self->{'buckets'}{$bucket_name} and $auto_create_bucket)
315 0 0 unless ($bucket_name)
322 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
338 0 0 if ($self->{'current_status'} eq 'OK')
360 0 0 unless ($file_id)
366 0 0 if ref $self->{'file_info'}{$file_id} eq 'HASH'
378 0 0 if ($self->{'current_status'} eq 'OK')
392 0 0 unless ($bucket_name)
408 0 0 if ($self->{'current_status'} eq 'OK')
427 0 0 unless ($bucket_name)
456 0 0 unless ($file_name and $file_id)
484 0 0 if ($args{'file_location'} and -e "$args{'file_location'}") { }
499 0 0 if ($stat->size < $self->{'recommended_part_size'})
505 0 0 unless ($bucket_name)
529 0 0 unless $large_file_id
541 0 0 if ($remaining_file_size < $self->{'recommended_part_size'}) { }
603 0 2 unless ($args{'url'})
608 1 1 if ($args{'authorization'})
616 0 2 if ($self->{'b2_login_error'})
625 0 2 if ($args{'url'} =~ /b2_upload_file|b2_upload_part/) { }
0 2 elsif (ref $args{'post_params'} eq 'HASH') { }
674 1 1 if ($response->header('X-Bz-File-Name')) { }
1 0 elsif ($response_code eq '200') { }
691 0 2 if ($@ or $response_code ne '200') { }
692 0 0 if ($self->{'b2_response'}{'message'}) { }
717 0 0 unless $error_message
740 2 0 unless $self->{'errors'}[0]