本文整理汇总了Python中timeseries.TimeSeries.as_list方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeries.as_list方法的具体用法?Python TimeSeries.as_list怎么用?Python TimeSeries.as_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timeseries.TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.as_list方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test010
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import as_list [as 别名]
def test010(self):
'TimeSeries.write_to_pi_file writes list to stream'
stream = mock.Stream()
obj = TimeSeries.as_list(self.testdata + "read.PI.timezone.2.xml")
TimeSeries.write_to_pi_file(stream, obj, offset=2)
target = file(self.testdata + "targetOutput.xml").read()
current = ''.join(stream.content)
self.assertEquals(target.strip(), current.strip())
示例2: test000
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import as_list [as 别名]
def test000(self):
'TimeSeries.write_to_pi_file writes list to new file'
obj = TimeSeries.as_list(self.testdata + "read.PI.timezone.2.xml")
TimeSeries.write_to_pi_file(self.testdata + "current.xml",
obj,
offset=2)
target = file(self.testdata + "targetOutput.xml").read()
current = file(self.testdata + "current.xml").read()
self.assertEquals(target.strip(), current.strip())
示例3: test201
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import as_list [as 别名]
def test201(self):
'TimeSeries.as_list reads stream'
stream = file(self.testdata + "read.PI.timezone.2.xml")
obj = TimeSeries.as_list(stream)
self.assertTrue(isinstance(obj, list))
self.assertEquals(2, len(obj))
示例4: test200
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import as_list [as 别名]
def test200(self):
'TimeSeries.as_list reads file given its name'
obj = TimeSeries.as_list(self.testdata + "read.PI.timezone.2.xml")
self.assertTrue(isinstance(obj, list))
self.assertEquals(2, len(obj))