Skip to content

Commit

Permalink
Fix valiables and format Azure#307
Browse files Browse the repository at this point in the history
  • Loading branch information
u5surf committed Jun 23, 2021
1 parent 485749d commit 9ab4a69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions sdk/core/src/request_options/ba512_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ impl fmt::Display for BA512Range {
#[cfg(test)]
mod test {
use super::*;
use crate::Not512ByteAlignedError::StartRange;
use crate::Not512ByteAlignedError::EndRange;
use crate::Not512ByteAlignedError::{StartRange, EndRange};

#[test]
fn test_512range_parse() {
Expand Down
24 changes: 12 additions & 12 deletions sdk/storage/src/core/into_azure_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,35 @@ mod test {
fn no_slash() {
let path = "containerblob";
let p = &path;
let _e = AzurePathParseError::PathSeparatorNotFoundError;
assert_eq!(p.container_name().unwrap_err(), _e);
assert_eq!(p.blob_name().unwrap_err(), _e);
let err = AzurePathParseError::PathSeparatorNotFoundError;
assert_eq!(p.container_name().unwrap_err(), err);
assert_eq!(p.blob_name().unwrap_err(), err);
}

#[test]
fn three_slashes() {
let path = "container/blob/extra";
let p = &path;
let _e = AzurePathParseError::MultiplePathSeparatorsFoundError;
assert_eq!(p.container_name().unwrap_err(), _e);
assert_eq!(p.blob_name().unwrap_err(), _e);
let err = AzurePathParseError::MultiplePathSeparatorsFoundError;
assert_eq!(p.container_name().unwrap_err(), err);
assert_eq!(p.blob_name().unwrap_err(), err);
}

#[test]
fn missing_container() {
let path = "/blob";
let p = &path;
let _e = AzurePathParseError::MissingContainerError;
assert_eq!(p.container_name().unwrap_err(), _e);
assert_eq!(p.blob_name().unwrap_err(), _e);
let err = AzurePathParseError::MissingContainerError;
assert_eq!(p.container_name().unwrap_err(), err);
assert_eq!(p.blob_name().unwrap_err(), err);
}

#[test]
fn missing_blob() {
let path = "container/";
let p = &path;
let _e = AzurePathParseError::MissingBlobError;
assert_eq!(p.container_name().unwrap_err(), _e);
assert_eq!(p.blob_name().unwrap_err(), _e);
let err = AzurePathParseError::MissingBlobError;
assert_eq!(p.container_name().unwrap_err(), err);
assert_eq!(p.blob_name().unwrap_err(), err);
}
}

0 comments on commit 9ab4a69

Please sign in to comment.