Initial commit

This commit is contained in:
2025-03-03 01:16:50 +03:00
parent be888d68b2
commit 2bef3a7fe4
11 changed files with 175 additions and 0 deletions

22
proxy/tests/test_rss_proxy.py Executable file
View File

@@ -0,0 +1,22 @@
import unittest
from proxy import app
class FlaskTestCase(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.app.testing = True
def test_healthcheck(self):
response = self.app.get('/health')
self.assertEqual(response.status_code, 200)
def test_proxy_missing_url(self):
response = self.app.get('/proxy')
self.assertEqual(response.status_code, 400)
def test_proxy_with_url(self):
test_url = 'https://tapochek.net/rss/rssdg.xml'
response = self.app.get(f'/proxy?url={test_url}')
self.assertEqual(response.status_code, 200)
self.assertTrue(response.data)