def test_session_logout(self, requests_mock): requests_mock.delete( "https://demo.dev/sessions/1", status_code=204, request_headers={"X-Auth-Token": "abc"}, ) conn = Connector("https://demo.dev", "user1", "pass1") conn.set_session_auth_data("/sessions", "/sessions/1", "abc") conn.logout()
def test_session_logout_no_session(self, requests_mock): conn = Connector("https://demo.dev", "user", "pass") conn.set_session_auth_data("/sessions") conn.logout()
def test_session_logout_expired_session(self, requests_mock): requests_mock.delete("https://demo.dev/sessions/1", status_code=401) conn = Connector("https://demo.dev", "user", "pass") conn.set_session_auth_data("/sessions", "/sessions/1", "invalid") conn.logout()
def test_basic_logout(self, requests_mock): conn = Connector("https://demo.dev", "user", "pass") conn.set_basic_auth_data("/test_auth") conn.logout()