@@ -27,10 +27,7 @@ async fn test_data_lake_file_system_functions() -> Result<(), Box<dyn Error + Se
27
27
StorageAccountClient :: new_access_key ( http_client. clone ( ) , & account, & master_key) ;
28
28
29
29
let resource_id = "https://storage.azure.com/" ;
30
- println ! ( "getting bearer token for '{}'..." , resource_id) ;
31
30
let bearer_token = DefaultCredential :: default ( ) . get_token ( resource_id) . await ?;
32
- println ! ( "token expires on {}" , bearer_token. expires_on) ;
33
- println ! ( ) ;
34
31
35
32
let data_lake_client = storage_account_client
36
33
. as_storage_client ( )
@@ -43,21 +40,16 @@ async fn test_data_lake_file_system_functions() -> Result<(), Box<dyn Error + Se
43
40
let mut fs_properties = Properties :: new ( ) ;
44
41
fs_properties. insert ( "AddedVia" , "Azure SDK for Rust" ) ;
45
42
46
- println ! ( "creating file system '{}'..." , & file_system_name) ;
47
43
let create_fs_response = file_system_client
48
44
. create ( )
49
45
. properties ( & fs_properties)
50
46
. execute ( )
51
47
. await ?;
52
- println ! ( "create file system response == {:?}" , create_fs_response) ;
53
48
assert ! (
54
49
create_fs_response. namespace_enabled,
55
50
"namespace should be enabled"
56
51
) ;
57
- println ! ( "namespace is enabled" ) ;
58
- println ! ( ) ;
59
52
60
- println ! ( "listing file systems..." ) ;
61
53
let mut stream = Box :: pin (
62
54
data_lake_client
63
55
. list ( )
@@ -69,14 +61,12 @@ async fn test_data_lake_file_system_functions() -> Result<(), Box<dyn Error + Se
69
61
for fs in list_fs_response. unwrap ( ) . file_systems {
70
62
if fs. name == file_system_name {
71
63
found = true ;
64
+ break ;
72
65
}
73
66
}
74
67
}
75
68
assert ! ( found, "did not find created file system" ) ;
76
- println ! ( "found created file system" ) ;
77
- println ! ( ) ;
78
69
79
- println ! ( "getting file system properties..." ) ;
80
70
let get_fs_props_response = file_system_client. get_properties ( ) . execute ( ) . await ?;
81
71
let properties_hashmap = get_fs_props_response. properties . hash_map ( ) ;
82
72
let added_via_option = properties_hashmap. get ( "AddedVia" ) ;
@@ -89,51 +79,30 @@ async fn test_data_lake_file_system_functions() -> Result<(), Box<dyn Error + Se
89
79
"Azure SDK for Rust" ,
90
80
"did not find expected property value for: AddedVia"
91
81
) ;
92
- println ! ( "found expected file system property: AddedVia" ) ;
93
- println ! ( ) ;
94
82
95
83
let file_name = "e2etest-file.txt" ;
96
84
97
- println ! ( "creating path '{}'..." , file_name) ;
98
- let create_path_response = file_system_client
85
+ file_system_client
99
86
. create_path ( Context :: default ( ) , file_name, CreatePathOptions :: default ( ) )
100
87
. await ?;
101
- println ! ( "create path response == {:?}" , create_path_response) ;
102
- println ! ( ) ;
103
88
104
- println ! ( "creating path '{}' (overwrite)..." , file_name) ;
105
- let create_path_response = file_system_client
89
+ file_system_client
106
90
. create_path ( Context :: default ( ) , file_name, CreatePathOptions :: default ( ) )
107
91
. await ?;
108
- println ! ( "create path response == {:?}" , create_path_response) ;
109
- println ! ( ) ;
110
92
111
- println ! ( "creating path '{}' (do not overwrite)..." , file_name) ;
112
93
let do_not_overwrite =
113
94
CreatePathOptions :: new ( ) . if_match_condition ( IfMatchCondition :: NotMatch ( "*" ) ) ;
114
95
let create_path_result = file_system_client
115
96
. create_path ( Context :: default ( ) , file_name, do_not_overwrite)
116
97
. await ;
117
98
assert ! ( create_path_result. is_err( ) ) ;
118
- println ! (
119
- "create path result (should fail) == {:?}" ,
120
- create_path_result
121
- ) ;
122
- println ! ( ) ;
123
99
124
- println ! ( "setting file system properties..." ) ;
125
100
fs_properties. insert ( "ModifiedBy" , "Iota" ) ;
126
- let set_fs_props_response = file_system_client
101
+ file_system_client
127
102
. set_properties ( Some ( & fs_properties) )
128
103
. execute ( )
129
104
. await ?;
130
- println ! (
131
- "set file system properties response == {:?}" ,
132
- set_fs_props_response
133
- ) ;
134
- println ! ( ) ;
135
105
136
- println ! ( "getting file system properties..." ) ;
137
106
let get_fs_props_response = file_system_client. get_properties ( ) . execute ( ) . await ?;
138
107
let properties_hashmap = get_fs_props_response. properties . hash_map ( ) ;
139
108
let modified_by_option = properties_hashmap. get ( "ModifiedBy" ) ;
@@ -146,13 +115,8 @@ async fn test_data_lake_file_system_functions() -> Result<(), Box<dyn Error + Se
146
115
"Iota" ,
147
116
"did not find expected property value for: ModifiedBy"
148
117
) ;
149
- println ! ( "found expected file system property: ModifiedBy" ) ;
150
- println ! ( ) ;
151
118
152
- println ! ( "deleting file system..." ) ;
153
- let delete_fs_response = file_system_client. delete ( ) . execute ( ) . await ?;
154
- println ! ( "delete file system response == {:?}" , delete_fs_response) ;
155
- println ! ( ) ;
119
+ file_system_client. delete ( ) . execute ( ) . await ?;
156
120
157
121
Ok ( ( ) )
158
122
}
0 commit comments