MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_login_bad_credentials

Function test_login_bad_credentials

client/src/cmds.rs:712–731  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

add_mock_loginMethod · 0.80
get_serviceMethod · 0.80
checkMethod · 0.45
expect_errMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected