本文整理汇总了Python中model.Model.loadBookmark方法的典型用法代码示例。如果您正苦于以下问题:Python Model.loadBookmark方法的具体用法?Python Model.loadBookmark怎么用?Python Model.loadBookmark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Model
的用法示例。
在下文中一共展示了Model.loadBookmark方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_loading_book_mark_good
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import loadBookmark [as 别名]
def test_loading_book_mark_good(self):
model = Model()
self.assertEqual(model.getStatus(), State.NO_OPEN_FILE)
model.loadBookmark(os.getcwd() + "\\bookmarks.html")
self.assertEqual(model.getStatus(), State.FILE_OPENED)
self.assertEqual(model.numberOfVideos(), 3)
示例2: test_benchmark_model_bookmark_regex
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import loadBookmark [as 别名]
def test_benchmark_model_bookmark_regex(self):
#just curious how long this takes
model = Model()
start = time()
clock()
model.loadBookmark(os.getcwd() + "\\test-files\\bookmark_1k_bomb.html")
seconds = time() - start
print("Loading Bookmark Files Took:", clock(), "Cycles. Seconds:", seconds)
示例3: test_loading_book_mark_bad
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import loadBookmark [as 别名]
def test_loading_book_mark_bad(self):
model = Model()
#test to make sure that if the file does not exist, the state
#is still NO_OPEN_FILE. We don't check if its EMPTY_FILE since
#that is just a flag state for the UI to display a error dialog box
#and instantly changes back to NO_OPEN_FILE after the UI has been informed.
self.assertEqual(model.getStatus(), State.NO_OPEN_FILE)
model.loadBookmark("")
self.assertEqual(model.getStatus(), State.NO_OPEN_FILE)
self.assertEqual(model.numberOfVideos(), 0)
示例4: test_video_skip
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import loadBookmark [as 别名]
def test_video_skip(self):
model = Model()
model.loadBookmark(os.getcwd() + "\\bookmarks.html")
#test skipping
self.assertEqual(model.videoStatus(0), videoState.QUEUED)
model.removeItemFromList(0)
self.assertEqual(model.videoStatus(0), videoState.SKIPPED)
model.queueItemFromList(0)
self.assertEqual(model.videoStatus(0), videoState.QUEUED)
#test cancelling
model.changeVideoStatus(0, videoState.DOWNLOADING)
model.removeItemFromList(0)
self.assertEqual(model.videoStatus(0), videoState.CANCELLED)
#queueing this should not work, should stay canceled
model.queueItemFromList(0)
self.assertEqual(model.videoStatus(0), videoState.CANCELLED)
示例5: test_using_youtube_title_if_non_bookmark
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import loadBookmark [as 别名]
def test_using_youtube_title_if_non_bookmark(self):
model = Model()
model.loadBookmark(os.getcwd() + "\\youtube-videos.txt")
self.assertEqual(model.output_title_format, titleFormat.USE_YOUTUBE_TITLE)