devtools/fill.py
branch3.0
changeset 428 7d80331a91d7
parent 0 b97547f5f1fa
child 1016 26387b836099
equal deleted inserted replaced
427:e894eec21a1b 428:7d80331a91d7
   134         """generates a consistent value for 'attrname' if it's a password"""
   134         """generates a consistent value for 'attrname' if it's a password"""
   135         return u'toto'
   135         return u'toto'
   136         
   136         
   137     def generate_integer(self, attrname, index):
   137     def generate_integer(self, attrname, index):
   138         """generates a consistent value for 'attrname' if it's an integer"""
   138         """generates a consistent value for 'attrname' if it's an integer"""
       
   139         choosed = self.generate_choice(attrname, index)
       
   140         if choosed is not None:
       
   141             return choosed
   139         minvalue, maxvalue = get_bounds(self.e_schema, attrname)
   142         minvalue, maxvalue = get_bounds(self.e_schema, attrname)
   140         if maxvalue is not None and maxvalue <= 0 and minvalue is None:
   143         if maxvalue is not None and maxvalue <= 0 and minvalue is None:
   141             minvalue = maxvalue - index # i.e. randint(-index, 0)
   144             minvalue = maxvalue - index # i.e. randint(-index, 0)
   142         else:
   145         else:
   143             maxvalue = maxvalue or index
   146             maxvalue = maxvalue or index