Skip to content

Commit

Permalink
refactor(test): Rename LOGOUT to EMPTY
Browse files Browse the repository at this point in the history
This name is more accurate for its uses.
  • Loading branch information
zecakeh authored and poljar committed Jul 9, 2022
1 parent 47cfac7 commit 2d06538
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/matrix-sdk-test/src/test_json/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ pub static LOGIN_TYPES: Lazy<JsonValue> = Lazy::new(|| {
})
});

pub static LOGOUT: Lazy<JsonValue> = Lazy::new(|| json!({}));
pub static EMPTY: Lazy<JsonValue> = Lazy::new(|| json!({}));

pub static EVENT_ID: Lazy<JsonValue> = Lazy::new(|| {
json!({
Expand Down
12 changes: 6 additions & 6 deletions crates/matrix-sdk-test/src/test_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
16 changes: 8 additions & 8 deletions crates/matrix-sdk/tests/integration/room/joined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/tests/integration/room/left.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2d06538

Please sign in to comment.