本文整理汇总了Python中stve.log.LOG类的典型用法代码示例。如果您正苦于以下问题:Python LOG类的具体用法?Python LOG怎么用?Python LOG使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LOG类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test
def test(self):
self.assertTrue("stve.picture" in self.service.keys())
self.assertTrue(self.service["stve.picture"].version() != None)
pic = self.service["stve.picture"].get()
self.assertTrue(self.get("system.tmp") != None)
L.info(os.path.join(self.get("system.tmp"), "test01.png"))
pic.info(pic.open(os.path.join(self.get("system.tmp"), "test01.png")))
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:8,代码来源:library_picture_05.py
示例2: test
def test(self):
self.assertTrue("stve.picture" in self.service.keys())
self.assertTrue(self.service["stve.picture"].version() != None)
pic = self.service["stve.picture"].get()
self.assertTrue(self.get("system.tmp") != None)
img = pic.open(os.path.join(self.get("system.tmp"), "test01.png"))
self.assertTrue(img != None)
rgb = pic.get_rgb(img)
self.assertTrue(len(rgb) == 3)
L.info(rgb)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:11,代码来源:library_picture_06.py
示例3: rm
def rm(self, filepath):
if not type(filepath) in [str, unicode]:
raise WorkspaceError("filepath must be strings.")
if not os.path.exists(filepath):
L.warning("it is not exists %s" % filepath)
else:
try:
os.remove(filepath)
return filepath
except Exception as e:
L.traceback()
raise WorkspaceError("Can't remove file %s. Please Check File Permission." % filepath)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:12,代码来源:workspace.py
示例4: execute
def execute(self, script, host, v=2):
if not os.path.exists(host):
raise TestRunnerError("%s is not exists." % (host))
sys.path.append(host)
suite = unittest.TestSuite()
loader = unittest.TestLoader()
module = self.load(script, host)
if not module:
L.warning("Not loaded module : %s" % script)
raise TestRunnerError("%s is not extended StveTestCase." % script)
else: suite.addTest(loader.loadTestsFromModule(module))
unittest.TextTestRunner(verbosity=v).run(suite)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:13,代码来源:stvetestrunner.py
示例5: test
def test(self):
self.assertTrue("stve.picture" in self.service.keys())
self.assertTrue(self.service["stve.picture"].version() != None)
pic = self.service["stve.picture"].get()
self.assertTrue(self.get("system.tmp") != None)
img = pic.open(os.path.join(self.get("system.tmp"), "test01.png"))
self.assertTrue(img != None)
binary_img = pic.binary(img)
r,g,b = pic.get_rgb(binary_img)
self.assertTrue(r == g)
self.assertTrue(g == b)
L.info("RGB (%s %s %s)" %(r, g, b))
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:13,代码来源:library_picture_10.py
示例6: register
def register(cls, host):
if not os.path.exists(host):
raise LibraryError("%s is not exists." % (host))
for fdn in os.listdir(host):
try:
if fdn.endswith(".pyc") or fdn.endswith(".py"):
pass
else:
sys.path.append(os.path.join(host, fdn))
f, n, d = imp.find_module("service")
module = imp.load_module("service", f, n, d)
cls.service[module.NAME] = module.FACTORY
sys.path.remove(os.path.join(host, fdn))
except Exception as e:
L.warning(str(e))
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:15,代码来源:stvetestcase.py
示例7: test
def test(self):
self.assertTrue("stve.picture" in self.service.keys())
self.assertTrue(self.service["stve.picture"].version() != None)
pic = self.service["stve.picture"].get()
self.assertTrue(self.get("system.tmp") != None)
img = pic.open(os.path.join(self.get("system.tmp"), "test01.png"))
self.assertTrue(img != None)
opencv_img = pic.to_opencv(img)
img2 = pic.to_pil(opencv_img)
self.assertTrue(img2 != None)
pic.save(img2, os.path.join(self.get("system.tmp"), "test02.png"))
img3 = pic.open(os.path.join(self.get("system.tmp"), "test01.png"))
self.assertTrue(img3 != None)
L.info(pic.info(img3))
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:16,代码来源:library_picture_08.py
示例8: execute_with_report
def execute_with_report(self, script, host, output):
if not os.path.exists(host):
raise TestRunnerError("%s is not exists." % (host))
sys.path.append(host)
if not os.path.exists(output):
raise TestRunnerError("%s is not exists." % (output))
suite = unittest.TestSuite()
loader = unittest.TestLoader()
module = self.load(script, host)
if not module:
L.warning("Not loaded module : %s" % script)
raise TestRunnerError("%s is not extended StveTestCase." % script)
else: suite.addTest(loader.loadTestsFromModule(module))
xmlrunner.XMLTestRunner(output=output).run(suite)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:16,代码来源:stvetestrunner.py
示例9: __init__
def __init__(self, path, clear=False):
if not type(path) in [str, unicode]:
raise WorkspaceError("path must be strings.")
self.default_path = os.path.abspath(path)
if os.path.exists(path):
if len(os.listdir(path)) > 0:
L.warning("It is not vacant folder in the path.")
if clear:
try:
for f in os.listdir(path):
shutil.rmtree(os.path.join(path, f))
except Exception as e:
L.traceback()
raise WorkspaceError("it must be vacant folder in the path.")
else:
self._mkdir_recursive(self.default_path)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:16,代码来源:workspace.py
示例10: load
def load(self, testcase, host):
if testcase.find(".py") != -1:
script = testcase
else:
script = testcase + ".py"
path = os.path.join(host, script)
if not os.path.exists(path):
raise TestRunnerError("%s is not exists." % (path))
name = script[:script.find(".")]
L.debug("TestCase : %s" % path)
try:
if os.path.exists(path):
f, n, d = imp.find_module(str(name))
return imp.load_module(name, f, n, d)
else:
return False
except ImportError as e:
L.traceback()
return False
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:19,代码来源:stvetestrunner.py
示例11: mkdir
def mkdir(self, folder, host="", clear=False):
if not type(folder) in [str, unicode]:
raise WorkspaceError("folder must be strings.")
if host == "":
path = os.path.join(self.root(), folder)
else:
if not os.path.exists(host): self._mkdir_recursive(host)
path = os.path.join(host, folder)
if os.path.exists(path):
if len(os.listdir(path)) > 0:
L.warning("It is not vacant folder in the path.")
if clear:
try:
for f in os.listdir(path):
shutil.rmtree(os.path.join(path, f))
except Exception as e:
L.traceback()
raise WorkspaceError("it must be vacant folder in the path.")
else:
self._mkdir_recursive(path)
return path
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:22,代码来源:workspace.py
示例12: rmdir
def rmdir(self, folder, host=""):
if not type(folder) in [str, unicode]:
raise WorkspaceError("folder must be strings.")
if host == "":
path = os.path.join(self.root(), folder)
else:
if not os.path.exists(host):
L.warning("it is not exists %s" % host)
return host
path = os.path.join(host, folder)
if not os.path.exists(path):
L.warning("it is not exists %s" % path)
return path
else:
try:
shutil.rmtree(path); return path
except Exception as e:
L.traceback()
raise WorkspaceError("Can't remove file %s. Please Check File Permission." % path)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:21,代码来源:workspace.py
示例13: tearDownClass
def tearDownClass(cls):
L.info("*** End TestCase : %s *** " % __file__)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:2,代码来源:library_picture_02.py
示例14: test
def test(self):
self.assertTrue("stve.picture" in self.service.keys())
self.assertTrue(self.service["stve.picture"].version() != None)
L.info(self.service["stve.picture"].version())
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:4,代码来源:library_picture_02.py
示例15: setUpClass
def setUpClass(cls):
L.info("*** Start TestCase : %s *** " % __file__)
开发者ID:TE-ToshiakiTanaka,项目名称:stve,代码行数:2,代码来源:library_picture_02.py
注:本文中的stve.log.LOG类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论