File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ mod tests {
255
255
#[ cfg( feature = "local_tests" ) ]
256
256
use super :: * ;
257
257
#[ cfg( feature = "local_tests" ) ]
258
- use crate :: dbus:: Service ;
258
+ use crate :: dbus:: { self , Service } ;
259
259
260
260
#[ cfg( feature = "local_tests" ) ]
261
261
async fn create_item ( service : Service < ' _ > , encrypted : bool ) {
@@ -268,7 +268,15 @@ mod tests {
268
268
attributes. insert ( "type" , value) ;
269
269
let secret = "a password" . as_bytes ( ) ;
270
270
271
- let collection = service. default_collection ( ) . await . unwrap ( ) ;
271
+ let collection = match service. default_collection ( ) . await {
272
+ Err ( dbus:: Error :: NotFound ( _) ) => {
273
+ service
274
+ . create_collection ( "Default" , Some ( dbus:: DEFAULT_COLLECTION ) )
275
+ . await
276
+ }
277
+ e => e,
278
+ }
279
+ . unwrap ( ) ;
272
280
let n_items = collection. items ( ) . await . unwrap ( ) . len ( ) ;
273
281
let n_search_items = collection. search_items ( & attributes) . await . unwrap ( ) . len ( ) ;
274
282
You can’t perform that action at this time.
0 commit comments