本文整理汇总了Python中testlib.eq函数的典型用法代码示例。如果您正苦于以下问题:Python eq函数的具体用法?Python eq怎么用?Python eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testIterReverseMiddle
def testIterReverseMiddle(self):
self.e.put('a', '')
self.e.put('b', '')
self.e.put('d', '')
self.e.put('e', '')
eq(strize(self.e.iter('c', True)),
[('d', ''), ('b', ''), ('a', '')])
示例2: do_test
def do_test(self, k):
packed = keylib.packs(k)
try:
unpacked = keylib.unpack(packed)
eq(k, keylib.unpack(keylib.packs(k)))
except:
print 'failing enc was: %r' % (packed,)
raise
示例3: test_delete_pop
def test_delete_pop(self):
self.insert_items()
self.coll.strategy.batch(max_recs=len(self.ITEMS))
# Pop should trigger split of batch and return of old value.
data = self.coll.strategy.pop(self.txn.get(), keylib.Key(3))
eq(data, '"jim"')
# Should now contain metadata + 2 remaining records.
assert len(self.e.items) == (self.old_len + 2)
示例4: test1
def test1(self):
for i in self.INTS:
s = keylib.packs(i)
try:
j, = keylib.unpack(s)
eq(j, i)
except:
print [i, s]
raise
示例5: test_pos
def test_pos(self):
tz = dateutil.tz.gettz('Etc/GMT+1')
dt = datetime.now(tz)
sn = _keylib.packs(dt)
sp = keylib.packs(dt)
eq(sn, sp)
dn = _keylib.unpacks(sn)
dp = keylib.unpacks(sp)
eq(dn, dp)
示例6: testGetExist
def testGetExist(self):
key = self.coll.put(u'')
eq(key, (1,))
eq('', self.coll.get(1))
key = self.coll.put(u'x')
eq(key, (2,))
eq(u'x', self.coll.get(2))
示例7: testReverseAutoInclude
def testReverseAutoInclude(self):
eq(self.REVERSE, self.riter('de'))
示例8: testForwardSkipMostExist
def testForwardSkipMostExist(self):
eq([([('de',),], '')], self.iter('de'))
示例9: testForwardSeekBeyondNoExist
def testForwardSeekBeyondNoExist(self):
eq([], self.iter('df'))
示例10: testForwardSeekNoExist
def testForwardSeekNoExist(self):
eq(self.ITEMS[1:], self.iter('b'))
示例11: testForwardSeekExist
def testForwardSeekExist(self):
eq(self.ITEMS[1:], self.iter('cc'))
示例12: testIterKeys
def testIterKeys(self):
eq([self.key, self.key2], list(self.i.keys()))
eq([self.key2, self.key], list(self.i.keys(reverse=True)))
示例13: testForwardSeekFirst
def testForwardSeekFirst(self):
eq(self.ITEMS, self.iter('aa'))
示例14: testReverseSeekNoExistInclude
def testReverseSeekNoExistInclude(self):
eq(self.REVERSE[1:], self.riter('ddd'))
示例15: testIterPairs
def testIterPairs(self):
eq(self.both, list(self.i.pairs()))
eq(self.both, list(self.i.pairs(lo=68)))
eq(self.both, list(self.i.pairs(lo=(69, u'dave'))))
eq(self.second, list(self.i.pairs(lo=(69, u'dave2'))))
eq([], list(self.i.pairs(lo=80)))
eq(self.both[::-1], list(self.i.pairs(reverse=True)))
self.coll.delete(self.key)
eq(self.second, list(self.i.pairs()))
self.coll.delete(self.key2)
eq([], list(self.i.pairs()))