MCPcopy Index your code
hub / github.com/SkyworkAI/DeepResearchAgent / test_github_system

Function test_github_system

tests/test_github_system.py:37–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 return args
36
37async def test_github_system():
38 # secret_from_env returns a function, need to call it to get the actual value
39 token = get_env("GITHUB_TOKEN")
40 username = get_env("GITHUB_USERNAME")
41
42 print(f"| Token: {token}")
43 print(f"| Username: {username}")
44
45 try:
46 github_env = GitHubEnvironment(
47 token=token.get_secret_value(),
48 username=username.get_secret_value()
49 )
50 await github_env.initialize()
51 logger.info(f"| GitHub Environment: {github_env}")
52
53 # Test some basic functionality
54 logger.info("| Testing GitHub environment...")
55 await github_env._create_repository(
56 name="test-repo",
57 description="Test repository",
58 private=True
59 )
60
61 except ValueError as e:
62 print(f"| Error getting secrets: {e}")
63 print("| Please set GITHUB_TOKEN and GITHUB_USERNAME environment variables")
64 return
65 except Exception as e:
66 logger.error(f"| Error initializing GitHub environment: {e}")
67 return
68 finally:
69 # Ensure proper cleanup
70 if 'github_env' in locals():
71 await github_env.cleanup()
72 logger.info("| GitHub environment cleaned up")
73
74async def main():
75 args = parse_args()

Callers 1

mainFunction · 0.85

Calls 7

initializeMethod · 0.95
cleanupMethod · 0.95
get_envFunction · 0.90
printFunction · 0.85
GitHubEnvironmentClass · 0.85
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected