import unittest
import uuid
from runtime import Service, deployment_manifest, network_policy, branding_config
class RuntimeTests(unittest.TestCase):
def test_powered_by_footer_only_uses_html_substitution(self):
config=branding_config(3000,{'hostedFooterEnabled':'true','hostedFooterText':'由 WebUp Cloud 提供服务','hostedFooterLink':'https://webup.run'})
self.assertIn('sub_filter',config)
self.assertIn('proxy_pass http://127.0.0.1:3000',config)
self.assertIn('proxy_set_header Upgrade',config)
self.assertNotIn('sub_filter_types application/json',config)
self.assertIsNone(branding_config(3000,{'hostedFooterEnabled':'false'}))
def test_footer_text_is_escaped(self):
config=branding_config(3000,{'hostedFooterEnabled':'true','hostedFooterText':"",'hostedFooterLink':'https://webup.run'})
self.assertNotIn('