feat: 初始化Easy Patch插件及依赖文件
- 添加Blender插件核心文件:__init__.py、ui.py、property.py、preference.py - 添加插件工具模块:g.py、loop.py、generate_loop.py、const.py、op.py - 添加翻译工具:utils/trans.py - 添加PuLP线性规划库及其依赖文件,包括CBC求解器二进制文件 - 添加.gitignore和VSCode配置文件
This commit is contained in:
36
utils/pulp/tests/test_examples.py
Normal file
36
utils/pulp/tests/test_examples.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
import unittest
|
||||
import pulp
|
||||
import shutil
|
||||
|
||||
|
||||
class Examples_DocsTests(unittest.TestCase):
|
||||
def test_examples(self, examples_dir="../../examples"):
|
||||
import importlib
|
||||
|
||||
this_file = os.path.realpath(__file__)
|
||||
parent_dir = os.path.dirname(this_file)
|
||||
files = os.listdir(os.path.join(parent_dir, examples_dir))
|
||||
TMP_dir = "_tmp/"
|
||||
if not os.path.exists(TMP_dir):
|
||||
os.mkdir(TMP_dir)
|
||||
for f_name in files:
|
||||
if os.path.isdir(f_name):
|
||||
continue
|
||||
_f_name = "examples." + os.path.splitext(f_name)[0]
|
||||
os.chdir(TMP_dir)
|
||||
importlib.import_module(_f_name)
|
||||
os.chdir("../")
|
||||
shutil.rmtree(TMP_dir)
|
||||
|
||||
def test_doctest(self):
|
||||
"""
|
||||
runs all doctests
|
||||
"""
|
||||
import doctest
|
||||
|
||||
doctest.testmod(pulp)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user