Ai
1 Star 0 Fork 3

QuecPython/FactoryTool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
module_test.py 834 Bytes
一键复制 编辑 原始数据 按行查看 历史
QuecPython 提交于 2022-10-11 11:48 +08:00 . new log module for Tool&Test
# 这里写需要导入的模块
import sim
import net
import uos
class TestBase(object):
def __init__(self):
self.method_list = [func for func in dir(self) if callable(getattr(self, func)) and not func.startswith("__")]
self.__run__()
def __run__(self):
for i in self.method_list:
print(eval("TestBase." + i + "()"))
# ------该区域为测试代码------
@staticmethod
def det_signal():
if sim.getStatus() == 1:
if net.getConfig()[0] == 5:
return True
else:
return False
@staticmethod
def det_file_space():
if uos.statvfs('usr')[3] > 5:
return True
else:
return False
# ------该区域为测试代码------
if __name__ == '__main__':
test_base = TestBase()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/quecpython_admin/FactoryTool.git
git@gitee.com:quecpython_admin/FactoryTool.git
quecpython_admin
FactoryTool
FactoryTool
main

搜索帮助