Beginning setup of new release testing.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
2025-06-15 09:46:50 -04:00
parent 5ed9f549a7
commit f6f8f0f205
8 changed files with 197 additions and 120 deletions

View File

@@ -0,0 +1,33 @@
"""Confirms translate moxcking is working."""
from unittest import IsolatedAsyncioTestCase
from uuid import uuid4
from aiohttp import ClientSession
from release_tests.support import ADDR
from release_tests.support.translate import Translate
class TranslateTC(IsolatedAsyncioTestCase):
"""Confirms the translate mocking is working."""
async def test_create_translater_server(self):
"""something"""
trans = Translate()
await trans.start()
async with ClientSession() as session:
async with session.get(f"http://{ADDR}:{trans.port}/") as resp:
text = await resp.text()
self.assertEqual(resp.status, 200, text)
async def test_url_reponses(self):
"""created url reponse the mocks"""
url = f"/{uuid4()}"
replies = [str(uuid4()), str(uuid4())]
trans = Translate(url=url, replies=replies)
await trans.start()
async with ClientSession() as session:
for reply in replies:
async with session.get(f"http://{ADDR}:{trans.port}{url}") as resp:
text = await resp.text()
self.assertEqual(resp.status, 200, text)
self.assertEqual(text, reply)