You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConfigObj (the library we use for our config files which provides that handy specfile concept) already has a way to indicate a valid range for integers. You can just drop this unit test and instead modify your configspec to read something like:
barcode_salt = integer(default=0, min=0, max=1000000)
barcode_event_id = integer(default=0, min=0, max=255)
barcode_key = string(min=10, max=10) # min and max refer to length for strings
The length restrictions are strings are from memory, so that might actually have a different syntax. Relatedly, if those config options are required for the plugin to function, you probably don't want default values, since you probably want an exception to be raised if they're not provided.
discussion from #1
ConfigObj (the library we use for our config files which provides that handy specfile concept) already has a way to indicate a valid range for integers. You can just drop this unit test and instead modify your configspec to read something like:
The length restrictions are strings are from memory, so that might actually have a different syntax. Relatedly, if those config options are required for the plugin to function, you probably don't want default values, since you probably want an exception to be raised if they're not provided.