add # 新增使用开源字体

This commit is contained in:
2026-10-26 11:34:00 +08:00
parent dc17f7f65c
commit 22cfddcf06
68 changed files with 1772 additions and 461 deletions
+16 -1
View File
@@ -18,9 +18,24 @@ class DataDirectoryTests(unittest.TestCase):
self.addCleanup(self.temp.cleanup)
self.base = Path(self.temp.name)
def test_default_and_explicit_directory(self):
def test_fixed_directory(self):
self.assertEqual(
self.module.data_directory(self.base), self.base / 'farm_db',
)
custom = self.base / 'custom'
self.assertEqual(self.module.data_directory(self.base, custom), custom)
self.assertEqual(self.module.data_directory(self.base, ''),
self.base / 'farm_db')
def test_nonebot_directory_is_fixed(self):
spec = importlib.util.spec_from_file_location(
'nonebot_farm_paths', ROOT / 'integrations/nonebot/data_paths.py',
)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
self.assertEqual(module.data_directory(self.base),
self.base / 'nonebot_plugin_farm/farm_db')
custom = self.base / 'custom'
self.assertEqual(module.data_directory(self.base, custom), custom)
self.assertEqual(module.data_directory(self.base, ''),
self.base / 'nonebot_plugin_farm/farm_db')