1 Star 5 Fork 1

open-source/labelGo-Yolov5AutoLabelImg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_settings.py 782 Bytes
一键复制 编辑 原始数据 按行查看 历史
saiki 提交于 4年前 . Initial commit
#!/usr/bin/env python
import os
import sys
import time
import unittest
__author__ = 'TzuTaLin'
dir_name = os.path.abspath(os.path.dirname(__file__))
libs_path = os.path.join(dir_name, '..', 'libs')
sys.path.insert(0, libs_path)
from settings import Settings
class TestSettings(unittest.TestCase):
def test_basic(self):
settings = Settings()
settings['test0'] = 'hello'
settings['test1'] = 10
settings['test2'] = [0, 2, 3]
self.assertEqual(settings.get('test3', 3), 3)
self.assertEqual(settings.save(), True)
settings.load()
self.assertEqual(settings.get('test0'), 'hello')
self.assertEqual(settings.get('test1'), 10)
settings.reset()
if __name__ == '__main__':
unittest.main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/python-open-source/labelGo-Yolov5AutoLabelImg.git
git@gitee.com:python-open-source/labelGo-Yolov5AutoLabelImg.git
python-open-source
labelGo-Yolov5AutoLabelImg
labelGo-Yolov5AutoLabelImg
master

搜索帮助