Branch Coverage

blib/lib/Backblaze/B2V2Client.pm
Criterion Covered Total %
branch 15 86 17.4


line true false branch
27 0 1 unless ($application_key_id and $application_key)
63 1 0 if ($self->{'current_status'} eq 'OK') { }
91 0 1 unless ($file_id)
106 0 1 if ($self->{'current_status'} eq 'OK' and $save_to_location)
122 0 0 unless ($bucket_name and $file_name)
138 0 0 if ($self->{'current_status'} eq 'OK' and $save_to_location)
156 0 0 unless ($save_to_location and -d "$save_to_location")
162 0 0 unless ($self->{'b2_response'}{'X-Bz-File-Name'} and length $self->{'b2_response'}{'file_contents'})
192 0 0 if ($args{'file_location'} and -e "$args{'file_location'}")
200 0 0 unless (length $args{'file_contents'})
206 0 0 unless ($args{'bucket_name'} and $args{'new_file_name'})
243 0 0 unless ($bucket_name)
254 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
268 0 0 if ($self->{'current_status'} eq 'OK')
304 0 0 if ($self->{'current_status'} eq 'OK') { }
318 0 0 if ($bucket_name and not $self->{'buckets'}{$bucket_name} and $auto_create_bucket)
335 0 0 unless ($bucket_name)
342 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
360 0 0 if ($self->{'current_status'} eq 'OK') { }
389 0 0 unless ($file_id)
395 0 0 if ref $self->{'file_info'}{$file_id} eq 'HASH'
407 0 0 if ($self->{'current_status'} eq 'OK')
423 0 0 unless ($bucket_name)
436 0 0 unless ($disable_encryption)
450 0 0 if ($self->{'current_status'} eq 'OK')
471 0 0 unless ($bucket_name)
501 0 0 unless ($file_name and $file_id)
530 0 0 if ($args{'file_location'} and -e "$args{'file_location'}") { }
545 0 0 if ($stat->size < $self->{'recommended_part_size'})
551 0 0 unless ($bucket_name)
575 0 0 unless $large_file_id
587 0 0 if ($remaining_file_size < $self->{'recommended_part_size'}) { }
650 0 2 unless ($args{'url'})
655 1 1 if ($args{'authorization'})
663 0 2 if ($self->{'b2_login_error'})
672 0 2 if ($args{'url'} =~ /b2_upload_file|b2_upload_part/) { }
0 2 elsif (ref $args{'post_params'} eq 'HASH') { }
721 1 1 if ($response->header('X-Bz-File-Name')) { }
1 0 elsif ($response_code eq '200') { }
738 0 2 if ($@ or $response_code ne '200') { }
739 0 0 if ($self->{'b2_response'}{'message'}) { }
766 0 0 unless $error_message
791 2 0 unless $self->{'errors'}[0]