@@ -1119,35 +1119,47 @@ mod test {
11191119 }
11201120
11211121 #[ async_test]
1122- async fn test_exists_on_server ( ) {
1122+ async fn test_when_a_backup_exists_then_exists_on_server_returns_true ( ) {
11231123 let server = MockServer :: start ( ) . await ;
11241124 let client = logged_in_client ( Some ( server. uri ( ) ) ) . await ;
11251125
1126- {
1127- let _scope = mock_backup_exists ( & server) . await ;
1126+ let _scope = mock_backup_exists ( & server) . await ;
11281127
1129- let exists = client
1130- . encryption ( )
1131- . backups ( )
1132- . exists_on_server ( )
1133- . await
1134- . expect ( "We should be able to check if backups exist on the server" ) ;
1128+ let exists = client
1129+ . encryption ( )
1130+ . backups ( )
1131+ . exists_on_server ( )
1132+ . await
1133+ . expect ( "We should be able to check if backups exist on the server" ) ;
11351134
1136- assert ! ( exists, "We should deduce that a backup exists on the server" ) ;
1137- }
1135+ assert ! ( exists, "We should deduce that a backup exists on the server" ) ;
11381136
1139- {
1140- let _scope = mock_backup_none ( & server ) . await ;
1137+ server . verify ( ) . await ;
1138+ }
11411139
1142- let exists = client
1143- . encryption ( )
1144- . backups ( )
1145- . exists_on_server ( )
1146- . await
1147- . expect ( "We should be able to check if backups exist on the server" ) ;
1140+ #[ async_test]
1141+ async fn test_when_no_backup_exists_then_exists_on_server_returns_false ( ) {
1142+ let server = MockServer :: start ( ) . await ;
1143+ let client = logged_in_client ( Some ( server. uri ( ) ) ) . await ;
11481144
1149- assert ! ( !exists, "We should deduce that no backup exists on the server" ) ;
1150- }
1145+ let _scope = mock_backup_none ( & server) . await ;
1146+
1147+ let exists = client
1148+ . encryption ( )
1149+ . backups ( )
1150+ . exists_on_server ( )
1151+ . await
1152+ . expect ( "We should be able to check if backups exist on the server" ) ;
1153+
1154+ assert ! ( !exists, "We should deduce that no backup exists on the server" ) ;
1155+
1156+ server. verify ( ) . await ;
1157+ }
1158+
1159+ #[ async_test]
1160+ async fn test_when_server_returns_an_error_then_exists_on_server_returns_an_error ( ) {
1161+ let server = MockServer :: start ( ) . await ;
1162+ let client = logged_in_client ( Some ( server. uri ( ) ) ) . await ;
11511163
11521164 {
11531165 let _scope = mock_backup_too_many_requests ( & server) . await ;
0 commit comments