def test_update(self): string = test.populate('string', size=100) values = test.populate('float', size=100) s = zset() s.update(zip(values, string)) self.assertTrue(s) prev = None for score, _ in s.items(): if prev is not None: self.assertTrue(score >= prev) prev = score return s
def test_update(self): string = test.populate('string', size=100) values = test.populate('float', size=100) s = zset() s.update(zip(values,string)) self.assertTrue(s) prev = None for score, _ in s.items(): if prev is not None: self.assertTrue(score>=prev) prev = score return s
def after_setup(cls): d = cls.data session = cls.session() with session.begin() as t: for g in d.groups: t.add(Group(name=g)) yield t.on_result groups = yield session.query(Group).all() gps = test.populate('choice', d.size, choice_from=groups) with session.begin() as t: for p, g in zip(d.persons, gps): t.add(cls.model(name=p, group=g)) yield t.on_result
def setUp(self): self.names = test.populate('string', size=10) self.name = self.names[0]