示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 def setUp(self):
     self.names = test.populate('string', size=10)
     self.name = self.names[0]
示例#6
0
 def setUp(self):
     self.names = test.populate('string', size=10)
     self.name = self.names[0]