From 2d0653894caf357636e3f211e9927dc781a46594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 9 Jul 2022 09:58:59 +0200 Subject: [PATCH] refactor(test): Rename LOGOUT to EMPTY This name is more accurate for its uses. --- crates/matrix-sdk-test/src/test_json/events.rs | 2 +- crates/matrix-sdk-test/src/test_json/mod.rs | 12 ++++++------ .../matrix-sdk/tests/integration/room/joined.rs | 16 ++++++++-------- crates/matrix-sdk/tests/integration/room/left.rs | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/matrix-sdk-test/src/test_json/events.rs b/crates/matrix-sdk-test/src/test_json/events.rs index ae5e36d68f9..5bb5a4d99bb 100644 --- a/crates/matrix-sdk-test/src/test_json/events.rs +++ b/crates/matrix-sdk-test/src/test_json/events.rs @@ -327,7 +327,7 @@ pub static LOGIN_TYPES: Lazy = Lazy::new(|| { }) }); -pub static LOGOUT: Lazy = Lazy::new(|| json!({})); +pub static EMPTY: Lazy = Lazy::new(|| json!({})); pub static EVENT_ID: Lazy = Lazy::new(|| { json!({ diff --git a/crates/matrix-sdk-test/src/test_json/mod.rs b/crates/matrix-sdk-test/src/test_json/mod.rs index 2f6c9cc5c11..c05d7f3b7e9 100644 --- a/crates/matrix-sdk-test/src/test_json/mod.rs +++ b/crates/matrix-sdk-test/src/test_json/mod.rs @@ -12,12 +12,12 @@ pub mod members; pub mod sync; pub use events::{ - ALIAS, ALIASES, ENCRYPTION, EVENT_ID, KEYS_QUERY, KEYS_UPLOAD, LOGIN, LOGIN_RESPONSE_ERR, - LOGIN_TYPES, LOGIN_WITH_DISCOVERY, LOGOUT, MEMBER, MEMBER_INVITE, MEMBER_NAME_CHANGE, - MEMBER_STRIPPED, MESSAGE_EDIT, MESSAGE_TEXT, NAME, NAME_STRIPPED, POWER_LEVELS, PRESENCE, - PUBLIC_ROOMS, PUSH_RULES, REACTION, READ_RECEIPT, READ_RECEIPT_OTHER, REDACTED, - REDACTED_INVALID, REDACTED_STATE, REDACTION, REGISTRATION_RESPONSE_ERR, ROOM_ID, ROOM_MESSAGES, - SYNC_ROOM_MESSAGES_BATCH_1, SYNC_ROOM_MESSAGES_BATCH_2, TAG, TOPIC, TYPING, + ALIAS, ALIASES, EMPTY, ENCRYPTION, EVENT_ID, KEYS_QUERY, KEYS_UPLOAD, LOGIN, + LOGIN_RESPONSE_ERR, LOGIN_TYPES, LOGIN_WITH_DISCOVERY, MEMBER, MEMBER_INVITE, + MEMBER_NAME_CHANGE, MEMBER_STRIPPED, MESSAGE_EDIT, MESSAGE_TEXT, NAME, NAME_STRIPPED, + POWER_LEVELS, PRESENCE, PUBLIC_ROOMS, PUSH_RULES, REACTION, READ_RECEIPT, READ_RECEIPT_OTHER, + REDACTED, REDACTED_INVALID, REDACTED_STATE, REDACTION, REGISTRATION_RESPONSE_ERR, ROOM_ID, + ROOM_MESSAGES, SYNC_ROOM_MESSAGES_BATCH_1, SYNC_ROOM_MESSAGES_BATCH_2, TAG, TOPIC, TYPING, }; pub use members::MEMBERS; pub use sync::{ diff --git a/crates/matrix-sdk/tests/integration/room/joined.rs b/crates/matrix-sdk/tests/integration/room/joined.rs index e255b183787..06b46aaf8ec 100644 --- a/crates/matrix-sdk/tests/integration/room/joined.rs +++ b/crates/matrix-sdk/tests/integration/room/joined.rs @@ -28,7 +28,7 @@ async fn invite_user_by_id() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/invite$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -51,7 +51,7 @@ async fn invite_user_by_3pid() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/invite$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -83,7 +83,7 @@ async fn leave_room() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/leave$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -105,7 +105,7 @@ async fn ban_user() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/ban$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -128,7 +128,7 @@ async fn kick_user() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/kick$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -151,7 +151,7 @@ async fn read_receipt() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/receipt")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -174,7 +174,7 @@ async fn read_marker() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/read_markers$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; @@ -197,7 +197,7 @@ async fn typing_notice() { Mock::given(method("PUT")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/typing")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await; diff --git a/crates/matrix-sdk/tests/integration/room/left.rs b/crates/matrix-sdk/tests/integration/room/left.rs index 435f4a1f639..2614db15034 100644 --- a/crates/matrix-sdk/tests/integration/room/left.rs +++ b/crates/matrix-sdk/tests/integration/room/left.rs @@ -17,7 +17,7 @@ async fn forget_room() { Mock::given(method("POST")) .and(path_regex(r"^/_matrix/client/r0/rooms/.*/forget$")) .and(header("authorization", "Bearer 1234")) - .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::LOGOUT)) + .respond_with(ResponseTemplate::new(200).set_body_json(&*test_json::EMPTY)) .mount(&server) .await;