style: remove trailing whitespace in mcp_server.py and test_runtime_clarity.py
This commit is contained in:
@@ -132,7 +132,7 @@ class TestRuntimeClarity(unittest.TestCase):
|
||||
res = mcp_server.gitea_list_profiles()
|
||||
profiles = res["profiles"]
|
||||
self.assertEqual(len(profiles), 2)
|
||||
|
||||
|
||||
author_prof = next(p for p in profiles if p["name"] == "author-profile")
|
||||
self.assertTrue(author_prof["is_active"])
|
||||
self.assertEqual(author_prof["role_kind"], "author")
|
||||
@@ -153,7 +153,7 @@ class TestRuntimeClarity(unittest.TestCase):
|
||||
with patch.dict(os.environ, self._env("author-profile", reveal="1"), clear=True):
|
||||
res = mcp_server.gitea_list_profiles()
|
||||
profiles = res["profiles"]
|
||||
|
||||
|
||||
author_prof = next(p for p in profiles if p["name"] == "author-profile")
|
||||
self.assertEqual(author_prof["auth"]["name"], "GITEA_TOKEN_AUTHOR")
|
||||
self.assertEqual(author_prof["base_url"], "https://gitea.example.com")
|
||||
@@ -173,7 +173,7 @@ class TestRuntimeClarity(unittest.TestCase):
|
||||
@patch("mcp_server.get_auth_header")
|
||||
def test_activate_profile_succeeds_when_enabled(self, mock_auth, mock_api):
|
||||
self._write_config(CONFIG_SWITCHING_ENABLED)
|
||||
|
||||
|
||||
# Setup mock responses for whoami checks
|
||||
mock_auth.side_effect = ["token author-pass", "token reviewer-pass"]
|
||||
mock_api.side_effect = [{"login": "author-user"}, {"login": "reviewer-user"}]
|
||||
@@ -181,15 +181,15 @@ class TestRuntimeClarity(unittest.TestCase):
|
||||
with patch.dict(os.environ, self._env("author-profile"), clear=True):
|
||||
# Check before state
|
||||
self.assertEqual(gitea_config.selected_profile_name(), "author-profile")
|
||||
|
||||
|
||||
res = mcp_server.gitea_activate_profile(profile_name="reviewer-profile")
|
||||
|
||||
|
||||
self.assertTrue(res["success"])
|
||||
self.assertEqual(res["before_profile"], "author-profile")
|
||||
self.assertEqual(res["before_identity"], "author-user")
|
||||
self.assertEqual(res["after_profile"], "reviewer-profile")
|
||||
self.assertEqual(res["after_identity"], "reviewer-user")
|
||||
|
||||
|
||||
# Global variable override should be set
|
||||
self.assertEqual(gitea_config._active_profile_override, "reviewer-profile")
|
||||
self.assertEqual(gitea_config.selected_profile_name(), "reviewer-profile")
|
||||
|
||||
Reference in New Issue
Block a user