()
| 710 | |
| 711 | #[test] |
| 712 | fn test_login_bad_credentials() { |
| 713 | let mut t = ClientTester::default(); |
| 714 | t.get_service().borrow_mut().add_mock_login( |
| 715 | "bad-user", |
| 716 | "the-password", |
| 717 | Err(io::Error::new(io::ErrorKind::PermissionDenied, "Unknown user")), |
| 718 | ); |
| 719 | t.run(format!(r#"LOGIN "{}", "{}""#, "bad-user", "the-password")) |
| 720 | .expect_err("1:1: Unknown user") |
| 721 | .check(); |
| 722 | t.get_service().borrow_mut().add_mock_login( |
| 723 | "the-username", |
| 724 | "bad-password", |
| 725 | Err(io::Error::new(io::ErrorKind::PermissionDenied, "Invalid password")), |
| 726 | ); |
| 727 | t.run(format!(r#"LOGIN "{}", "{}""#, "the-username", "bad-password")) |
| 728 | .expect_err("1:1: Invalid password") |
| 729 | .check(); |
| 730 | assert!(!t.get_storage().borrow().mounted().contains_key("CLOUD")); |
| 731 | } |
| 732 | |
| 733 | #[test] |
| 734 | fn test_login_twice() { |
nothing calls this directly
no test coverage detected