本文整理汇总了Python中DataStore.getStatuses方法的典型用法代码示例。如果您正苦于以下问题:Python DataStore.getStatuses方法的具体用法?Python DataStore.getStatuses怎么用?Python DataStore.getStatuses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore.getStatuses方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_TweetCountup
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [as 别名]
def test_TweetCountup(self):
ds = DataStore()
ds.addStatus(Type.normal, u'status1')
ds.addStatus(Type.normal, u'status2')
ds.addStatus(Type.normal, u'status3')
for i in range(0,5):
ds.tweetCountup(Type.normal, u'status1')
for i in range(0,4):
ds.tweetCountup(Type.normal, u'status2')
for i in range(0,3):
ds.tweetCountup(Type.normal, u'status3')
normallst = ds.getStatuses(Type.normal)
assert_true((normallst[0][1]==u'status1' and normallst[0][3]==5))
assert_true((normallst[1][1]==u'status2' and normallst[1][3]==4))
assert_true((normallst[2][1]==u'status3' and normallst[2][3]==3))
ds.tweetCountAdjust(Type.normal)
normallst = ds.getStatuses(Type.normal)
assert_true((normallst[0][1]==u'status1' and normallst[0][3]==2))
assert_true((normallst[1][1]==u'status2' and normallst[1][3]==1))
assert_true((normallst[2][1]==u'status3' and normallst[2][3]==0))
ds.tweetCountAdjust(Type.normal)
normallst = ds.getStatuses(Type.normal)
assert_true((normallst[0][1]==u'status1' and normallst[0][3]==2))
assert_true((normallst[1][1]==u'status2' and normallst[1][3]==1))
assert_true((normallst[2][1]==u'status3' and normallst[2][3]==0))
示例2: test_removeStatusesSelectType
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [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'))
示例3: test_removeStatuses
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [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))
示例4: test_setPrioStatus
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [as 别名]
def test_setPrioStatus(self):
ds = DataStore()
ds.addStatus(Type.priority, u'prioAbc')
lst = ds.getStatuses(Type.priority)
detect = False
for s in lst:
if s[1] == u'prioAbc':
detect = True
# 優先ステータスが登録されること
assert_true(detect)
示例5: test_AddStatus
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [as 别名]
def test_AddStatus(self):
ds = DataStore()
ds.addStatus(Type.normal, u'abc')
lst = ds.getStatuses(Type.normal)
detect = False
for s in lst:
if s[1] == u'abc':
detect = True
# ステータスが登録されること
assert_true(detect)
示例6: test_DeleteStatus
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [as 别名]
def test_DeleteStatus(self):
ds = DataStore()
ds.addStatus(Type.normal, u'abc')
ds.removeStatus(Type.normal, u'abc')
lst = ds.getStatuses(Type.normal)
detect = False
for s in lst:
if s[1] == u'abc':
detect = True
# 登録したステータスが削除されること
assert_false(detect)
示例7: test_DeleteAllStatus
# 需要导入模块: import DataStore [as 别名]
# 或者: from DataStore import getStatuses [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))