mirror of
https://github.com/Shu-Ying/main_plugin_farm.git
synced 2026-10-29 13:40:00 +08:00
add # 新增使用开源字体
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user