本文整理汇总了Python中DataStore.removeStatuses方法的典型用法代码示例。如果您正苦于以下问题:Python DataStore.removeStatuses方法的具体用法?Python DataStore.removeStatuses怎么用?Python DataStore.removeStatuses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore.removeStatuses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_removeStatusesSelectType
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import removeStatuses [as 别名]
def test_removeStatusesSelectType(self):
ds = DataStore()
ds.addStatus(Type.normal, u'status1')
ds.addStatus(Type.normal, u'status2')
ds.addStatus(Type.normal, u'status3')
ds.addStatus(Type.priority, u'priority1')
ds.addStatus(Type.priority, u'priority2')
ds.addStatus(Type.priority, u'priority3')
ds.addStatus(Type.omikuji, u'omikuji1')
ds.addStatus(Type.omikuji, u'omikuji2')
ds.addStatus(Type.omikuji, u'omikuji3')
ds.removeStatuses(Type.normal)
normallst = ds.getStatuses(Type.normal)
assert_equal(0, len(normallst))
prioritylst = ds.getStatuses(Type.priority)
assert_true((Type.priority==prioritylst[0][0] and prioritylst[0][1]==u'priority1'))
assert_true((Type.priority==prioritylst[1][0] and prioritylst[1][1]==u'priority2'))
assert_true((Type.priority==prioritylst[2][0] and prioritylst[2][1]==u'priority3'))
omikujilst = ds.getStatuses(Type.omikuji)
assert_true((Type.omikuji==omikujilst[0][0] and omikujilst[0][1]==u'omikuji1'))
assert_true((Type.omikuji==omikujilst[1][0] and omikujilst[1][1]==u'omikuji2'))
assert_true((Type.omikuji==omikujilst[2][0] and omikujilst[2][1]==u'omikuji3'))
示例2: test_removeStatuses
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import removeStatuses [as 别名]
def test_removeStatuses(self):
ds = DataStore()
ds.addStatus(Type.normal, u'status1')
ds.addStatus(Type.normal, u'status2')
ds.addStatus(Type.normal, u'status3')
ds.addStatus(Type.priority, u'priority1')
ds.addStatus(Type.priority, u'priority2')
ds.addStatus(Type.priority, u'priority3')
ds.addStatus(Type.omikuji, u'omikuji1')
ds.addStatus(Type.omikuji, u'omikuji2')
ds.addStatus(Type.omikuji, u'omikuji3')
ds.removeStatuses()
normallst = ds.getStatuses(Type.normal)
assert_equal(0, len(normallst))
prioritylst = ds.getStatuses(Type.priority)
assert_equal(0, len(prioritylst))
omikujilst = ds.getStatuses(Type.omikuji)
assert_equal(0, len(omikujilst))
示例3: test_DeleteAllStatus
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import removeStatuses [as 别名]
def test_DeleteAllStatus(self):
ds = DataStore()
ds.addStatus(Type.normal, u'abc')
ds.addStatus(Type.normal, u'def')
ds.addStatus(Type.normal, u'ghi')
ds.addStatus(Type.priority, u'abc')
ds.addStatus(Type.priority, u'def')
ds.addStatus(Type.priority, u'ghi')
ds.removeStatuses()
# リストが0件であること
lst = ds.getStatuses()
assert_equal(0, len(lst))