mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 11:43:57 +01:00
fix tests
This commit is contained in:
parent
16cbc07c9c
commit
6945ff1133
8 changed files with 14 additions and 2 deletions
|
@ -44,7 +44,7 @@ pub trait Download<'w>
|
||||||
///
|
///
|
||||||
/// let TgFile { file_path, .. } = bot.get_file("*file_id*").send().await?;
|
/// let TgFile { file_path, .. } = bot.get_file("*file_id*").send().await?;
|
||||||
/// let mut file = File::create("/tmp/test.png").await?;
|
/// let mut file = File::create("/tmp/test.png").await?;
|
||||||
/// bot.download_file(&file_path, &mut file).await?;
|
/// bot.download_file(&file_path.unwrap(), &mut file).await?;
|
||||||
/// # Ok(()) }
|
/// # Ok(()) }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
|
@ -78,6 +78,8 @@ mod tests {
|
||||||
last_name: None,
|
last_name: None,
|
||||||
username: None,
|
username: None,
|
||||||
language_code: None,
|
language_code: None,
|
||||||
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
},
|
},
|
||||||
chat_instance: "123456".to_string(),
|
chat_instance: "123456".to_string(),
|
||||||
message: None,
|
message: None,
|
||||||
|
|
|
@ -704,6 +704,8 @@ mod tests {
|
||||||
last_name: Some("Last".to_string()),
|
last_name: Some("Last".to_string()),
|
||||||
username: Some("fl".to_string()),
|
username: Some("fl".to_string()),
|
||||||
language_code: Some("en".to_string()),
|
language_code: Some("en".to_string()),
|
||||||
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
},
|
},
|
||||||
kind: ChatMemberKind::Administrator(Administrator {
|
kind: ChatMemberKind::Administrator(Administrator {
|
||||||
custom_title: None,
|
custom_title: None,
|
||||||
|
|
|
@ -62,7 +62,7 @@ mod tests {
|
||||||
file_id: "FILE_ID".to_owned(),
|
file_id: "FILE_ID".to_owned(),
|
||||||
file_unique_id: "FILE_UNIQUE_ID".to_owned(),
|
file_unique_id: "FILE_UNIQUE_ID".to_owned(),
|
||||||
file_size: Some(42),
|
file_size: Some(42),
|
||||||
file_path: Some("".to_owned()),
|
file_path: None,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ mod tests {
|
||||||
username: Some("SomethingSomethingBot".to_owned()),
|
username: Some("SomethingSomethingBot".to_owned()),
|
||||||
language_code: None,
|
language_code: None,
|
||||||
is_premium: false,
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
},
|
},
|
||||||
can_join_groups: false,
|
can_join_groups: false,
|
||||||
can_read_all_group_messages: false,
|
can_read_all_group_messages: false,
|
||||||
|
|
|
@ -1511,6 +1511,8 @@ mod tests {
|
||||||
slow_mode_delay: None,
|
slow_mode_delay: None,
|
||||||
linked_chat_id: None,
|
linked_chat_id: None,
|
||||||
location: None,
|
location: None,
|
||||||
|
join_by_request: None,
|
||||||
|
join_to_send_messages: None,
|
||||||
}),
|
}),
|
||||||
description: None,
|
description: None,
|
||||||
invite_link: None,
|
invite_link: None,
|
||||||
|
|
|
@ -355,6 +355,8 @@ mod test {
|
||||||
last_name: None,
|
last_name: None,
|
||||||
username: Some(String::from("WaffleLapkin")),
|
username: Some(String::from("WaffleLapkin")),
|
||||||
language_code: Some(String::from("en")),
|
language_code: Some(String::from("en")),
|
||||||
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
}),
|
}),
|
||||||
reply_to_message: None,
|
reply_to_message: None,
|
||||||
forward: None,
|
forward: None,
|
||||||
|
|
|
@ -146,6 +146,7 @@ mod tests {
|
||||||
username: Some("Username".to_string()),
|
username: Some("Username".to_string()),
|
||||||
language_code: Some(String::from("ru")),
|
language_code: Some(String::from("ru")),
|
||||||
is_premium: false,
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
};
|
};
|
||||||
let actual = serde_json::from_str::<User>(json).unwrap();
|
let actual = serde_json::from_str::<User>(json).unwrap();
|
||||||
assert_eq!(actual, expected)
|
assert_eq!(actual, expected)
|
||||||
|
@ -161,6 +162,7 @@ mod tests {
|
||||||
username: Some("aaaaaaaaaaaaaaaa".to_owned()),
|
username: Some("aaaaaaaaaaaaaaaa".to_owned()),
|
||||||
language_code: None,
|
language_code: None,
|
||||||
is_premium: false,
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let user_b = User {
|
let user_b = User {
|
||||||
|
@ -171,6 +173,7 @@ mod tests {
|
||||||
username: None,
|
username: None,
|
||||||
language_code: None,
|
language_code: None,
|
||||||
is_premium: false,
|
is_premium: false,
|
||||||
|
added_to_attachment_menu: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(user_a.full_name(), "First Last");
|
assert_eq!(user_a.full_name(), "First Last");
|
||||||
|
|
Loading…
Reference in a new issue