本文整理汇总了Python中genologics.lims.Lims.tostring方法的典型用法代码示例。如果您正苦于以下问题:Python Lims.tostring方法的具体用法?Python Lims.tostring怎么用?Python Lims.tostring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类genologics.lims.Lims
的用法示例。
在下文中一共展示了Lims.tostring方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestEntities
# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import tostring [as 别名]
class TestEntities(TestCase):
dummy_xml = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dummy></dummy>"""
def setUp(self):
self.lims = Lims(url, username='test', password='password')
def _tostring(self, entity):
return self.lims.tostring(ElementTree.ElementTree(entity.root)).decode("utf-8")
示例2: test_tostring
# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import tostring [as 别名]
def test_tostring(self):
lims = Lims(self.url, username=self.username, password=self.password)
from xml.etree import ElementTree as ET
a = ET.Element('a')
b = ET.SubElement(a, 'b')
c = ET.SubElement(a, 'c')
d = ET.SubElement(c, 'd')
etree = ET.ElementTree(a)
expected_string=b"""<?xml version='1.0' encoding='utf-8'?>
<a><b /><c><d /></c></a>"""
string = lims.tostring(etree)
assert string == expected_string