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

Function test_login_show_motd_on_wide_console

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

Source from the content-addressed store, hash-verified

686
687 #[test]
688 fn test_login_show_motd_on_wide_console() {
689 let mut t = ClientTester::default();
690 t.get_service().borrow_mut().add_mock_login(
691 "the-username",
692 "the-password",
693 Ok(LoginResponse {
694 access_token: AccessToken::new("random token"),
695 motd: vec!["first line".to_owned(), "second line".to_owned()],
696 }),
697 );
698 t.run(format!(r#"LOGIN "{}", "{}""#, "the-username", "the-password"))
699 .expect_prints([
700 "",
701 "----- BEGIN SERVER MOTD -----",
702 "first line",
703 "second line",
704 "----- END SERVER MOTD -----",
705 "",
706 ])
707 .expect_access_token("random token")
708 .check();
709 }
710
711 #[test]
712 fn test_login_bad_credentials() {

Callers

nothing calls this directly

Calls 6

add_mock_loginMethod · 0.80
get_serviceMethod · 0.80
expect_access_tokenMethod · 0.80
checkMethod · 0.45
expect_printsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected