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

Function test_login_twice

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

Source from the content-addressed store, hash-verified

732
733 #[test]
734 fn test_login_twice() {
735 let mut t = ClientTester::default();
736 t.get_service().borrow_mut().add_mock_login(
737 "the-username",
738 "the-password",
739 Ok(LoginResponse { access_token: AccessToken::new("random token"), motd: vec![] }),
740 );
741 assert!(!t.get_storage().borrow().mounted().contains_key("CLOUD"));
742 t.run(r#"LOGIN "the-username", "the-password": LOGIN "a", "b""#)
743 .expect_access_token("random token")
744 .expect_err("1:39: Cannot LOGIN again before LOGOUT")
745 .check();
746 assert!(t.get_storage().borrow().mounted().contains_key("CLOUD"));
747 }
748
749 #[test]
750 fn test_login_errors() {

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_errMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected