mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-07 22:16:39 +00:00
Generalize OCI device setup and remove unused catalog hashes
This commit is contained in:
@@ -29,10 +29,13 @@ class DescriptionTests(unittest.TestCase):
|
||||
self.assertIn('Image: <code>adguard/adguardhome:latest</code> ', notes)
|
||||
self.assertIn('>Image</a> · ', notes)
|
||||
self.assertIn('>App</a>', notes)
|
||||
self.assertNotIn('>App docs</a>', notes)
|
||||
self.assertNotIn('>Repository</a>', notes)
|
||||
self.assertIn('href="http://192.168.0.42:3000/" target="_blank" rel="noopener noreferrer">Setup (first run)</a>', notes)
|
||||
self.assertIn('>http://192.168.0.42:3000/</a>', notes)
|
||||
self.assertIn('href="http://192.168.0.42:80/" target="_blank" rel="noopener noreferrer">Web UI (after setup)</a>', notes)
|
||||
self.assertIn('>http://192.168.0.42:80/</a>', notes)
|
||||
self.assertEqual(notes.count('🌐 '), 2)
|
||||
|
||||
def test_missing_ip_does_not_publish_placeholder_links(self):
|
||||
template = json.loads((CATALOG / 'adguard-home.json').read_text())
|
||||
@@ -40,6 +43,14 @@ class DescriptionTests(unittest.TestCase):
|
||||
self.assertNotIn('http://:3000', notes)
|
||||
self.assertIn('proxmenux-instance=' + INSTANCE, notes)
|
||||
|
||||
def test_chromium_notes_keep_only_image_and_app_links(self):
|
||||
template = json.loads((CATALOG / 'chromium.json').read_text())
|
||||
notes = render(template, '', INSTANCE, '192.168.0.37')
|
||||
self.assertIn('>Image</a>', notes)
|
||||
self.assertIn('>App</a>', notes)
|
||||
self.assertNotIn('>App docs</a>', notes)
|
||||
self.assertNotIn('>Repository</a>', notes)
|
||||
|
||||
def test_untrusted_title_is_escaped(self):
|
||||
template = {'id': 'example', 'catalog_ui': {'title': {'en_US': '<script>x</script>'}},
|
||||
'container_contract': {'image': {'reference': 'example:latest'}}}
|
||||
|
||||
Reference in New Issue
Block a user