equal
deleted
inserted
replaced
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 |