Skip to content

Commit

Permalink
change ChatMember into Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Jun 26, 2021
1 parent 371fe34 commit 8b10415
Show file tree
Hide file tree
Showing 3 changed files with 503 additions and 348 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Expand Up @@ -18,26 +18,26 @@ jobs:
include:
- os: ubuntu-latest
toolchain: stable
clippyargs: -D clippy::pedantic -D warnings
clippyargs: -D clippy::pedantic -D warnings -A clippy::struct-excessive-bools
- os: macOS-latest
toolchain: stable
clippyargs: -D clippy::pedantic -D warnings
clippyargs: -D clippy::pedantic -D warnings -A clippy::struct-excessive-bools
- os: windows-latest
toolchain: stable
clippyargs: -D clippy::pedantic -D warnings
clippyargs: -D clippy::pedantic -D warnings -A clippy::struct-excessive-bools

- os: ubuntu-latest
toolchain: nightly
clippyargs: -W clippy::pedantic
clippyargs: -W clippy::pedantic -A clippy::struct-excessive-bools
# - os: ubuntu-latest
# toolchain: 1.41.1 # Debian 10 Buster
# clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints
- os: ubuntu-latest
toolchain: 1.47.0 # Alpine 3.13
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints -A clippy::struct-excessive-bools
- os: ubuntu-latest
toolchain: 1.48.0 # Debian 11 Bullseye
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints
clippyargs: -W clippy::pedantic -A unknown-lints -A clippy::unknown-clippy-lints -A clippy::struct-excessive-bools
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 2 additions & 2 deletions src/api_impl.rs
Expand Up @@ -1165,7 +1165,7 @@ mod tests {

#[test]
fn get_chat_administrators_success() {
let response_string = "{\"ok\":true,\"result\":[{\"user\":{\"id\":1276618370,\"is_bot\":true,\"first_name\":\"test_el_bot\",\"username\":\"el_mon_test_bot\"},\"status\":\"administrator\",\"is_anonymous\":false,\"can_be_edited\":false,\"can_manage_chat\":true,\"can_delete_messages\":true,\"can_manage_voice_chats\":true,\"can_restrict_members\":true,\"can_promote_members\":true,\"can_change_info\":true,\"can_invite_users\":true,\"can_pin_messages\":true},{\"user\":{\"id\":275808073,\"is_bot\":false,\"first_name\":\"Ayrat\",\"last_name\":\"Badykov\",\"username\":\"Ayrat555\",\"language_code\":\"en\"},\"status\":\"creator\",\"is_anonymous\":false}]}";
let response_string = "{\"ok\":true,\"result\":[{\"status\":\"administrator\",\"user\":{\"id\":1276618370,\"is_bot\":true,\"first_name\":\"test_el_bot\",\"username\":\"el_mon_test_bot\"},\"can_be_edited\":false,\"is_anonymous\":true,\"can_manage_chat\":true,\"can_delete_messages\":true,\"can_manage_voice_chats\":true,\"can_restrict_members\":true,\"can_promote_members\":false,\"can_change_info\":true,\"can_invite_users\":true,\"can_pin_messages\":true},{\"status\":\"creator\",\"user\":{\"id\":275808073,\"is_bot\":false,\"first_name\":\"Ayrat\",\"last_name\":\"Badykov\",\"username\":\"Ayrat555\",\"language_code\":\"en\"},\"is_anonymous\":false}]}";
let params = GetChatAdministratorsParams::new(ChatId::Integer(-1001368460856));

let _m = mockito::mock("POST", "/getChatAdministrators")
Expand Down Expand Up @@ -1199,7 +1199,7 @@ mod tests {

#[test]
fn get_chat_member_success() {
let response_string = "{\"ok\":true,\"result\":{\"user\":{\"id\":275808073,\"is_bot\":false,\"first_name\":\"Ayrat\",\"last_name\":\"Badykov\",\"username\":\"Ayrat555\",\"language_code\":\"en\"},\"status\":\"creator\",\"is_anonymous\":false}}";
let response_string = "{\"ok\":true,\"result\":{\"status\":\"creator\",\"user\":{\"id\":275808073,\"is_bot\":false,\"first_name\":\"Ayrat\",\"last_name\":\"Badykov\",\"username\":\"Ayrat555\",\"language_code\":\"en\"},\"is_anonymous\":false}}";
let params = GetChatMemberParams::new(ChatId::Integer(-1001368460856), 275808073);

let _m = mockito::mock("POST", "/getChatMember")
Expand Down

0 comments on commit 8b10415

Please sign in to comment.