Jeff Baskin f73d091dc2
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Added initial cluster setup.
2025-06-17 16:50:54 -04:00

26 lines
969 B
Python

"""Testing the the cluster."""
from unittest import IsolatedAsyncioTestCase
from aiohttp import ClientSession
from release_tests.support.cluster import Cluster
class ClusterTC(IsolatedAsyncioTestCase):
"""Test for the MoreThanText cluster."""
async def test_create_default_cluster(self):
"""create a complete two server cluster."""
cluster = Cluster()
await cluster.start()
async with ClientSession() as session:
url = cluster.translate.baseurl
async with session.get(url) as resp:
text = await resp.text()
self.assertEqual(resp.status, 200, text)
self.assertEqual(len(cluster.servers), 2)
for server in cluster.servers:
url = server.baseurl
async with session.get(url) as resp:
text = await resp.text()
self.assertEqual(resp.status, 200, text)
await cluster.stop()