Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,11 @@ mod tests {
let error = client.delete_key("invalid_key").await.unwrap_err();
assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::ApiKeyNotFound,
error_type: ErrorType::InvalidRequest,
..
}
})
));

// ==> executing the action without enough right
Expand All @@ -681,21 +681,21 @@ mod tests {
let error = client.delete_key("invalid_key").await.unwrap_err();
assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKey,
error_type: ErrorType::Auth,
..
}
})
));
// with a good key
let error = client.delete_key(&key.key).await.unwrap_err();
assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKey,
error_type: ErrorType::Auth,
..
}
})
));

// cleanup
Expand Down Expand Up @@ -741,7 +741,7 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::MeilisearchError {
error_code: ErrorCode::InvalidApiKeyIndexes,
error_type: ErrorType::InvalidRequest,
..
Expand All @@ -756,11 +756,11 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKeyExpiresAt,
error_type: ErrorType::InvalidRequest,
..
}
})
));

// ==> executing the action without enough right
Expand All @@ -776,11 +776,11 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKey,
error_type: ErrorType::Auth,
..
}
})
));

// cleanup
Expand Down Expand Up @@ -830,7 +830,7 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::MeilisearchError {
error_code: ErrorCode::InvalidApiKeyIndexes,
error_type: ErrorType::InvalidRequest,
..
Expand All @@ -844,11 +844,11 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKeyExpiresAt,
error_type: ErrorType::InvalidRequest,
..
}
})
));
key.expires_at = None;

Expand All @@ -864,11 +864,11 @@ mod tests {

assert!(matches!(
error,
Error::MeiliSearchError {
Error::Meilisearch(MeilisearchError {
error_code: ErrorCode::InvalidApiKey,
error_type: ErrorType::Auth,
..
}
})
));

// cleanup
Expand Down
Loading