Added initial cluster setup.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
25
release_tests/support/test_cluster.py
Normal file
25
release_tests/support/test_cluster.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user