def setUp(self):
     super(TestNonNegativeInteger, self).setUp()
     self.field = fields.NonNegativeIntegerField()
     self.coerce_good_values = [(1, 1), ('1', 1)]
     self.coerce_bad_values = ['-2', '4.2', 'foo', None]
     self.to_primitive_values = self.coerce_good_values[0:1]
     self.from_primitive_values = self.coerce_good_values[0:1]
Beispiel #2
0
class HugepagesConf(base.DrydockObject):

    VERSION = '1.0'

    fields = {
        'name': ovo_fields.StringField(),
        'size': ovo_fields.StringField(),
        'count': ovo_fields.NonNegativeIntegerField(),
    }