本文整理汇总了Python中model.Model.setOutputFormat方法的典型用法代码示例。如果您正苦于以下问题:Python Model.setOutputFormat方法的具体用法?Python Model.setOutputFormat怎么用?Python Model.setOutputFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Model
的用法示例。
在下文中一共展示了Model.setOutputFormat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gets_and_sets
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import setOutputFormat [as 别名]
def test_gets_and_sets(self):
model = Model()
model.setFilePath("C:\bookmark.html")
model.setOutputPath("C:\downloads")
model.setOutputFormat(Format.WAV)
model.setOutputTitleFormat(titleFormat.USE_YOUTUBE_TITLE)
model.setOutputQuality(Quality.HIGH)
model.setStatus(State.OPENING_FILE)
self.assertEqual(model.getFilePath(), "C:\bookmark.html")
self.assertEqual(model.getOutputPath(), "C:\downloads")
self.assertEqual(model.getOutputFormat(), Format.WAV)
self.assertEqual(model.getOutputTitleFormat(), titleFormat.USE_YOUTUBE_TITLE)
self.assertEqual(model.getOutputQuality(), Quality.HIGH)
self.assertEqual(model.getStatus(), State.OPENING_FILE)
示例2: test_correct_bounding_setters
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import setOutputFormat [as 别名]
def test_correct_bounding_setters(self):
model = Model()
original_OutputFormat = model.getOutputFormat()
original_OutputTitleFormat = model.getOutputTitleFormat()
original_getOutputQuality = model.getOutputQuality()
original_Status = model.getStatus()
#try to set value to one that is not defined as a constant
model.setOutputFormat(-1)
model.setOutputTitleFormat(-1)
model.setOutputQuality(-1)
model.setStatus(-1)
self.assertEqual(model.getOutputFormat(), original_OutputFormat)
self.assertEqual(model.getOutputTitleFormat(), original_OutputTitleFormat)
self.assertEqual(model.getOutputQuality(), original_getOutputQuality)
self.assertEqual(model.getStatus(), original_Status)
示例3: test_disable_setters_when_downloading
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import setOutputFormat [as 别名]
def test_disable_setters_when_downloading(self):
model = Model()
model.setFilePath("A")
model.setOutputPath("A")
model.setOutputFormat(Format.FLV)
model.setOutputTitleFormat(titleFormat.USE_BOOKMARK_TITLE)
model.setOutputQuality(Quality.NORMAL)
model.setStatus(State.DOWNLOADING)
model.setFilePath("B")
model.setOutputPath("B")
model.setOutputFormat(Format.WAV)
model.setOutputTitleFormat(titleFormat.USE_YOUTUBE_TITLE)
model.setOutputQuality(Quality.HIGH)
self.assertEqual(model.getFilePath(), "A")
self.assertEqual(model.getOutputPath(), "A")
self.assertEqual(model.getOutputFormat(), Format.FLV)
self.assertEqual(model.getOutputTitleFormat(), titleFormat.USE_BOOKMARK_TITLE)
self.assertEqual(model.getOutputQuality(), Quality.NORMAL)