本文整理匯總了Python中ovirtsdk4.reader.Reader.read_decimals方法的典型用法代碼示例。如果您正苦於以下問題:Python Reader.read_decimals方法的具體用法?Python Reader.read_decimals怎麽用?Python Reader.read_decimals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ovirtsdk4.reader.Reader
的用法示例。
在下文中一共展示了Reader.read_decimals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_read_decimals_with_one_value
# 需要導入模塊: from ovirtsdk4.reader import Reader [as 別名]
# 或者: from ovirtsdk4.reader.Reader import read_decimals [as 別名]
def test_read_decimals_with_one_value():
"""
Test given one value returns list containing one value.
"""
io_buffer = make_buffer('<list><value>1.1</value></list>')
xml_reader = XmlReader(io_buffer)
assert_equals(Reader.read_decimals(xml_reader), [1.1])
示例2: test_read_decimals_empty_list_without_close_tag
# 需要導入模塊: from ovirtsdk4.reader import Reader [as 別名]
# 或者: from ovirtsdk4.reader.Reader import read_decimals [as 別名]
def test_read_decimals_empty_list_without_close_tag():
"""
Test given no values without close tag returns empty list.
"""
io_buffer = make_buffer('<list/>')
xml_reader = XmlReader(io_buffer)
assert_equals(Reader.read_decimals(xml_reader), [])
示例3: test_read_decimals_with_two_values
# 需要導入模塊: from ovirtsdk4.reader import Reader [as 別名]
# 或者: from ovirtsdk4.reader.Reader import read_decimals [as 別名]
def test_read_decimals_with_two_values():
"""
Test given two values returns list containing two values.
"""
io_buffer = make_buffer(
'<list><value>1.1</value><value>2.2</value></list>'
)
xml_reader = XmlReader(io_buffer)
assert_equals(Reader.read_decimals(xml_reader), [1.1, 2.2])