Branch Coverage

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


line true false branch
27 0 1 unless ($application_key_id and $application_key)
63 1 0 if ($self->{'current_status'} eq 'OK') { }
88 0 1 unless ($file_id)
103 0 1 if ($self->{'current_status'} eq 'OK' and $save_to_location)
117 0 0 unless ($bucket_name and $file_name)
133 0 0 if ($self->{'current_status'} eq 'OK' and $save_to_location)
148 0 0 unless ($save_to_location and -d "$save_to_location")
154 0 0 unless ($self->{'b2_response'}{'X-Bz-File-Name'} and length $self->{'b2_response'}{'file_contents'})
181 0 0 if ($args{'file_location'} and -e "$args{'file_location'}")
189 0 0 unless (length $args{'file_contents'})
195 0 0 unless ($args{'bucket_name'} and $args{'new_file_name'})
230 0 0 unless ($bucket_name)
241 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
255 0 0 if ($self->{'current_status'} eq 'OK')
288 0 0 if ($self->{'current_status'} eq 'OK')
300 0 0 if ($bucket_name and not $self->{'buckets'}{$bucket_name} and $auto_create_bucket)
316 0 0 unless ($bucket_name)
323 0 0 if (ref $self->{'buckets'}{$bucket_name} ne 'HASH')
339 0 0 if ($self->{'current_status'} eq 'OK')
361 0 0 unless ($file_id)
367 0 0 if ref $self->{'file_info'}{$file_id} eq 'HASH'
379 0 0 if ($self->{'current_status'} eq 'OK')
393 0 0 unless ($bucket_name)
409 0 0 if ($self->{'current_status'} eq 'OK')
428 0 0 unless ($bucket_name)
457 0 0 unless ($file_name and $file_id)
485 0 0 if ($args{'file_location'} and -e "$args{'file_location'}") { }
500 0 0 if ($stat->size < $self->{'recommended_part_size'})
506 0 0 unless ($bucket_name)
530 0 0 unless $large_file_id
542 0 0 if ($remaining_file_size < $self->{'recommended_part_size'}) { }
604 0 2 unless ($args{'url'})
609 1 1 if ($args{'authorization'})
617 0 2 if ($self->{'b2_login_error'})
626 0 2 if ($args{'url'} =~ /b2_upload_file|b2_upload_part/) { }
0 2 elsif (ref $args{'post_params'} eq 'HASH') { }
675 1 1 if ($response->header('X-Bz-File-Name')) { }
1 0 elsif ($response_code eq '200') { }
692 0 2 if ($@ or $response_code ne '200') { }
693 0 0 if ($self->{'b2_response'}{'message'}) { }
718 0 0 unless $error_message
741 2 0 unless $self->{'errors'}[0]