本文整理汇总了Python中sickrage.show.Show.Show._validate_indexer_id方法的典型用法代码示例。如果您正苦于以下问题:Python Show._validate_indexer_id方法的具体用法?Python Show._validate_indexer_id怎么用?Python Show._validate_indexer_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickrage.show.Show.Show
的用法示例。
在下文中一共展示了Show._validate_indexer_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_validate_indexer_id
# 需要导入模块: from sickrage.show.Show import Show [as 别名]
# 或者: from sickrage.show.Show.Show import _validate_indexer_id [as 别名]
def test_validate_indexer_id(self):
"""
Test validate indexer id
"""
sickbeard.QUALITY_DEFAULT = Quality.FULLHDTV
show123 = TestTVShow(0, 123)
show456 = TestTVShow(0, 456)
show789 = TestTVShow(0, 789)
sickbeard.showList = [
show123,
show456,
show789,
]
invalid_show_id = ('Invalid show ID', None)
indexer_id_list = [
None, '', u'', '123', u'123', '456', u'456', '789', u'789', 123, 456, 789, ['123', '456'], [u'123', u'456'],
[123, 456]
]
results_list = [
invalid_show_id, invalid_show_id, invalid_show_id, (None, show123), (None, show123), (None, show456),
(None, show456), (None, show789), (None, show789), (None, show123), (None, show456), (None, show789),
invalid_show_id, invalid_show_id, invalid_show_id
]
self.assertEqual(
len(indexer_id_list), len(results_list),
'Number of parameters (%d) and results (%d) does not match' % (len(indexer_id_list), len(results_list))
)
for (index, indexer_id) in enumerate(indexer_id_list):
self.assertEqual(Show._validate_indexer_id(indexer_id), results_list[index]) # pylint: disable=protected-access