feat: Implement user profile preferences for start page, Git identity, and task drawer auto-open, alongside Git server default branch configuration.
This commit is contained in:
31
test_pat_retrieve.py
Normal file
31
test_pat_retrieve.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import asyncio
|
||||
from src.core.database import SessionLocal
|
||||
from src.models.git import GitServerConfig, GitProvider
|
||||
from src.api.routes.git_schemas import GitServerConfigCreate
|
||||
from src.api.routes.git import test_git_config
|
||||
|
||||
async def run():
|
||||
db = SessionLocal()
|
||||
config_create = GitServerConfigCreate(
|
||||
name="test",
|
||||
provider=GitProvider.GITEA,
|
||||
url="https://git.bebesh.ru",
|
||||
pat="********",
|
||||
config_id="f3e7652c-b850-4df9-9773-99e7f9d73dea"
|
||||
)
|
||||
|
||||
# Let's mock git_service.test_connection to see what PAT it gets it
|
||||
from src.api.routes import git
|
||||
|
||||
original_test = git.git_service.test_connection
|
||||
async def mock_test(provider, url, pat):
|
||||
print(f"PAT received by mock: '{pat}'")
|
||||
return True
|
||||
|
||||
git.git_service.test_connection = mock_test
|
||||
try:
|
||||
await test_git_config(config_create, db=db)
|
||||
finally:
|
||||
git.git_service.test_connection = original_test
|
||||
|
||||
asyncio.run(run())
|
||||
Reference in New Issue
Block a user