chore: import upstream snapshot with attribution
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
PROVIDER_CMD = (ROOT / "deeptutor_cli" / "provider_cmd.py").read_text(encoding="utf-8")
|
||||
CLI_README = (ROOT / "deeptutor_cli" / "README.md").read_text(encoding="utf-8")
|
||||
ROOT_README = (ROOT / "README.md").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
class ProviderCliDocsContractTest(unittest.TestCase):
|
||||
def test_provider_contract_describes_copilot_as_validation_not_oauth_login(self) -> None:
|
||||
self.assertIn(
|
||||
'help="Provider: openai-codex (OAuth login) | github-copilot (validate existing Copilot auth)"',
|
||||
PROVIDER_CMD,
|
||||
)
|
||||
self.assertIn('"""Authenticate or validate provider access."""', PROVIDER_CMD)
|
||||
self.assertIn("GitHub Copilot auth validation succeeded.", PROVIDER_CMD)
|
||||
self.assertIn("GitHub Copilot auth validation failed:", PROVIDER_CMD)
|
||||
self.assertNotIn("OAuth provider: openai-codex | github-copilot", PROVIDER_CMD)
|
||||
self.assertNotIn("GitHub Copilot OAuth authentication succeeded.", PROVIDER_CMD)
|
||||
|
||||
def test_readmes_match_the_cli_contract(self) -> None:
|
||||
self.assertIn(
|
||||
"Provider auth (`openai-codex` OAuth login; `github-copilot` validates an existing Copilot auth session)",
|
||||
ROOT_README,
|
||||
)
|
||||
self.assertIn(
|
||||
"deeptutor provider login github-copilot # 校验现有 GitHub Copilot 认证是否可用",
|
||||
CLI_README,
|
||||
)
|
||||
self.assertNotIn("OAuth login (`openai-codex`, `github-copilot`)", ROOT_README)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user