import unittest
from ..preferences import get_url_render_mode_pref
class TestPreferences(unittest.TestCase):
def test_get_url_render_mode_pref(self):
prefs = {}
self.assertIsNone(get_url_render_mode_pref(
prefs,
"gemini://example.com",
))
prefs["gemini://example.com"] = {}
prefs["gemini://example.com"] = {"render_mode": "test"}
self.assertEqual(get_url_render_mode_pref(
), "test")
"gemini://example.com/path",
prefs["gemini://example.com/specific/subdir"] = {"render_mode": "test2"}
"gemini://example.com/specific",
"gemini://example.com/specific/subdir",
), "test2")
"gemini://example.com/specific/subdir/subsubdir",