Initial curated ITWorx_MCP_Hub source from 368fba691ea8d23403b4d56b53b5ec670d7c5020
This commit is contained in:
commit
cb5be898ea
663 files changed
+82674
No files matched your search
@@ -0,0 +1,41 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from services.control_api.contextforge.client import ContextForgeClient
|
||||
from services.control_api.contextforge.models import ContextForgeSettings, GatewayDesiredState
|
||||
|
||||
|
||||
@unittest.skipUnless(
|
||||
os.getenv("WP050_CONTEXTFORGE_URL") and os.getenv("WP050_CONTEXTFORGE_TOKEN"),
|
||||
"set WP050_CONTEXTFORGE_URL and WP050_CONTEXTFORGE_TOKEN for the real 1.0.6 Compose test",
|
||||
)
|
||||
class RealContextForgeIntegrationTests(unittest.TestCase):
|
||||
def test_health_version_and_isolated_gateway_lifecycle(self) -> None:
|
||||
settings = ContextForgeSettings(
|
||||
base_url=os.environ["WP050_CONTEXTFORGE_URL"],
|
||||
auth_token_env="WP050_CONTEXTFORGE_TOKEN", # noqa: S106
|
||||
auth_scheme="Bearer",
|
||||
retries=1,
|
||||
)
|
||||
client = ContextForgeClient(settings)
|
||||
desired = GatewayDesiredState(
|
||||
slug="wp050-integration-gateway",
|
||||
url="https://example.com/mcp",
|
||||
description="Disposable WP-050 integration gateway",
|
||||
)
|
||||
try:
|
||||
self.assertEqual(client.health().get("status"), "healthy")
|
||||
self.assertEqual(client.version(), "1.0.6")
|
||||
handle = client.ensure_gateway(desired)
|
||||
self.assertEqual(handle.snapshot.slug, desired.slug)
|
||||
same = client.ensure_gateway(desired)
|
||||
self.assertEqual(same.external_id, handle.external_id)
|
||||
client.delete_gateway(handle)
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user