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

Function test_login_logout_flow_multiple

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

Source from the content-addressed store, hash-verified

830
831 #[test]
832 fn test_login_logout_flow_multiple() {
833 let mut t = ClientTester::default();
834 t.get_service().borrow_mut().add_mock_login(
835 "u1",
836 "p1",
837 Ok(LoginResponse { access_token: AccessToken::new("token 1"), motd: vec![] }),
838 );
839 t.get_service().borrow_mut().add_mock_login(
840 "u2",
841 "p2",
842 Ok(LoginResponse { access_token: AccessToken::new("token 2"), motd: vec![] }),
843 );
844 assert!(!t.get_storage().borrow().mounted().contains_key("CLOUD"));
845 t.run(r#"LOGIN "u1", "p1": LOGOUT: LOGIN "u2", "p2""#)
846 .expect_prints(["", " Unmounted CLOUD drive", " Good bye!", ""])
847 .expect_access_token("token 2")
848 .check();
849 assert!(t.get_storage().borrow().mounted().contains_key("CLOUD"));
850 }
851
852 #[test]
853 fn test_share_parse_acl_ok() {

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