summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_parameters.py
Commit message (Collapse)AuthorAgeFilesLines
* Make an ipa-tests packagePetr Viktorin2013-06-171-1533/+0
| | | | | | | Rename the 'tests' directory to 'ipa-tests', and create an ipa-tests RPM containing the test suite Part of the work for: https://fedorahosted.org/freeipa/ticket/3654
* Drop support for CSV in the CLI clientPetr Viktorin2013-02-221-17/+0
| | | | | Ticket: https://fedorahosted.org/freeipa/ticket/3352 Design: http://freeipa.org/page/V3/Drop_CSV
* Remove csv_separator and csv_skipspace Param argumentsPetr Viktorin2013-02-221-31/+0
| | | | | | These were never set to anything but the defaults. Part of work for https://fedorahosted.org/freeipa/ticket/3352
* Raise ValidationError on invalid CSV values.Jan Cholasta2013-02-081-0/+4
| | | | https://fedorahosted.org/freeipa/ticket/3323
* Switch %r specifiers to '%s' in Public errorsLynn Root2012-12-111-9/+9
| | | | | | | | | | | This switch drops the preceding 'u' from strings within Public error messages. This patch also addresses the related unfriendly 'u' from re-raising errors from netaddr.IPAddress by passing a bytestring through the function. Also switched ValidationError to TypeError in validate_scalar per jcholast@redhat.com. Ticket: https://fedorahosted.org/freeipa/ticket/3121 Ticket: https://fedorahosted.org/freeipa/ticket/2588
* Improve StrEnum validation error messageMartin Kosek2012-10-011-2/+23
| | | | | | | | Do not print list of possible values as "%r" but simply as a list of quoted values which should make it easier to read for users. Also add a special case when there is just one allowed value. https://fedorahosted.org/freeipa/ticket/2869
* Decimal parameter conversion and normalizationMartin Kosek2012-06-171-1/+92
| | | | | | | | | | | | | | | | | Parameter Decimal does not have a sufficient value checks. Some values cause Decimal parameter with a custom precision to crash with an unhandled exception. Improve parameter conversion and normalization operations to handle decimal exceptions more gracefully. Decimal parameter now also has new attributes enabling 2 new validation/normalization methods: * exponential: when False, decimal number is normalized to its non-exponential form * numberclass: a set of allowed decimal number classes (e.g. +Infinity, -Normal, ...) that are enforced for every Decimal parameter value https://fedorahosted.org/freeipa/ticket/2705
* Change parameters to use only default_from for dynamic default values.Jan Cholasta2012-03-281-33/+16
| | | | | | | | | Replace all occurences of create_default with equivalent default_from and remove create_default from the framework. This is needed for proper parameter validation, as there is no way to tell which parameters to validate prior to calling create_default, because create_default does not provide information about which parameters are used for generating the default value.
* Only split CSV in the client, quote instead of escapingPetr Viktorin2012-03-201-12/+12
| | | | | | | | | | | | | | | | | Splitting on commas is not an idempotent operation: 'a,b\,c' -> ('a', 'b,c') -> ('a', 'b', 'c') That means we can't do it when the call is forwarded, so this is only done on the CLI. The UI already sends values as a tuple. Replace escaping in the csv parser with quoting. Quoted strings can have embedded commas instead of having to escape them. This prevents the csv parser from eating all escape characters. Also, document Param's csv arguments, and update tests. https://fedorahosted.org/freeipa/ticket/2417 https://fedorahosted.org/freeipa/ticket/2227
* Replace float with DecimalMartin Kosek2012-01-201-23/+24
| | | | | | | | | | | | | | | | | | | | Having float type as a base type for floating point parameters in ipalib introduces several issues, e.g. problem with representation or value comparison. Python language provides a Decimal type which help overcome these issues. This patch replaces a float type and Float parameter with a decimal.Decimal type in Decimal parameter. A precision attribute was added to Decimal parameter that can be used to limit a number of decimal places in parameter representation. This approach fixes a problem with API.txt validation where comparison of float values may fail on different architectures due to float representation error. In order to safely transfer the parameter value over RPC it is being converted to string which is then converted back to decimal.Decimal number on a server side. https://fedorahosted.org/freeipa/ticket/2260
* Parse comma-separated lists of values in all parameter types. This can be ↵Jan Cholasta2011-11-301-60/+50
| | | | | | | | | | | | | enabled for a specific parameter by setting the "csv" option to True. Remove "List" parameter type and replace all occurences of it with appropriate multi-valued parameter ("Str" in most cases) with csv enabled. Add new parameter type "Any", capable of holding values of any type. This is needed by the "batch" command, as "Str" is not suitable type for the "methods" parameter. ticket 2007
* Fix message in test case for checking minimum valuesRob Crittenden2011-07-281-1/+1
|
* Set a default minimum value for class Int, handle long values better.Rob Crittenden2011-07-191-3/+3
| | | | | | | Allow a long to get as far as the min/max constraints where we can compare it to min/max int values and reject with a proper error message. https://fedorahosted.org/freeipa/ticket/1494
* Fix i18n related failures in unit tests.Pavel Zuna2011-03-011-22/+22
|
* Convert json strings to unicode when they are unmarshalled.Rob Crittenden2011-02-111-1/+1
| | | | | | | | | This patch removes some individual work-arounds of converting strings to unicode, they only masked the problem. String values are not passed to the validator or normalizers so things like adding the realm automatically to services weren't happening. ticket 941
* Fix failed tests. API for utcoffset changed and strings are more robust.Rob Crittenden2011-01-241-3/+4
| | | | | | | In Python 2.7 the API for time.utcoffset() changed. We do more automatic conversions of strings so need to loosen the tests a bit.
* Change FreeIPA license to GPLv3+Jakub Hrozek2010-12-201-5/+5
| | | | | | | | | | The changes include: * Change license blobs in source files to mention GPLv3+ not GPLv2 only * Add GPLv3+ license text * Package COPYING not LICENSE as the license blobs (even the old ones) mention COPYING specifically, it is also more common, I think https://fedorahosted.org/freeipa/ticket/239
* Allow RDN changes from CLIJakub Hrozek2010-12-201-0/+28
| | | | https://fedorahosted.org/freeipa/ticket/397
* Add new parameter type IA5Str and use this to enforce the right charset.Rob Crittenden2010-12-071-0/+23
| | | | ticket 496
* Use context to decide which name to return on RequirementsErrorsRob Crittenden2010-10-281-11/+17
| | | | | | | | | | | | | | When a Requirement fails we throw an exception including the name of the field that is missing. To make the command-line friendlier we have a cli_name defined which may or may not match the LDAP attribute. This can be confusing if you are using ipalib directly because the attribute name missing may not match what is actually required (desc vs description is a good example). If you use the context 'cli' then it will throw exceptions using cli_name. If you use any other context it will use the name of the attribute. ticket 187
* Add weekly periodic schedule to AccessTime param type.root2010-05-041-3/+2
| | | | Fix bug #588414
* Add test cases for AccessTime param and fix some problems in AccessTimeRob Crittenden2010-05-031-0/+40
|
* localize doc stringsJohn Dennis2010-03-081-3/+3
| | | | | | | | | | | | A number of doc strings were not localized, wrap them in _(). Some messages were not localized, wrap them in _() Fix a couple of failing tests: The method name in RPC should not be unicode. The doc attribute must use the .msg attribute for comparison. Also clean up imports of _() The import should come from ipalib or ipalib.text, not ugettext from request.
* Translatable Param.label, Param.docJason Gerard DeRose2010-02-241-3/+3
|
* Allow one-character Param namesRob Crittenden2010-02-121-4/+0
| | | | This is done explicitly to support the l/localityname attribute.
* Take 2: Extensible return values and validation; steps toward a single ↵Jason Gerard DeRose2009-12-101-46/+12
| | | | output_for_cli(); enable more webUI stuff
* Reading INT parameter class should respect radix prefixJohn Dennis2009-11-231-0/+27
| | | | | | | | | | This modifies the original patch by including a unit test, handling floats when passed as unicode, and handling large magnitude values beyond maxint. The INT parameter class was not respecting any radix prefix (e.g. 0x) the user may have supplied. This patch implements _convert_scalar method for the Int class so that we can pass the special radix base of zero to the int constructor telling it to determine the radix from the prefix (if present).
* _convert_scalar() should throw an error if passed a tuple or listRob Crittenden2009-11-171-1/+7
| | | | | A parameter needs to have multivalue set in order to work on lists/tuples and even then _convert_scalar() will be sent one value at a time.
* Change Password param so (password, confirm_password) can be passed to ↵Jason Gerard DeRose2009-10-181-0/+11
| | | | _convert_scalar()
* Giant webui patch take 2Jason Gerard DeRose2009-10-131-0/+21
|
* Fix unit tests for plugins using baseldap classes.Pavel Zuna2009-10-051-8/+9
|
* Added Param 'include' and 'exclude' kwargs; added frontend.UsesParams base ↵Jason Gerard DeRose2009-05-191-2/+37
| | | | class with methods implementing the filtering to restrict params to only certain contexts
* Rename errors2.py to errors.py. Modify all affected files.Pavel Zuna2009-04-231-10/+10
|
* Add new type List that converts delimited values into a tupleRob Crittenden2009-03-201-0/+59
|
* Add maxvalue and minvalue kwargs and rules to Int and FloatRob Crittenden2009-03-031-0/+168
|
* Add pattern matching to Str and BytesJason Gerard DeRose2009-02-171-1/+69
|
* Added some missing parameter unit tests; added docstring about ↵Jason Gerard DeRose2009-02-031-3/+41
| | | | Command._repr_iter() and Param.safe_value()
* Further migration toward new xmlrcp code; fixed problem with unicode ↵Jason Gerard DeRose2009-02-031-0/+2
| | | | Fault.faultString; fixed problem where ServerProxy method was not called correctly
* Added Command.args_options_2_params() method and its unit testsJason Gerard DeRose2009-02-031-0/+2
|
* Fixed Param.validate() so that self.query is checked after self.requiredJason Gerard DeRose2009-01-201-1/+2
|
* Added missing enumerable parametersJason Gerard DeRose2009-01-181-0/+49
|
* New Param: added Param.query kwarg for crud operations like Retrieve and ↵Jason Gerard DeRose2009-01-141-2/+9
| | | | Search where criteria should not be validated
* New Param: split common Bytes/Str functionality into new Data base class; ↵Jason Gerard DeRose2009-01-141-0/+53
| | | | Str no longer subclasses from Bytes
* Updated all references to 'parameter' module to 'parameters'Jason Gerard DeRose2009-01-141-50/+50
|
* New Param: renamed parameter.py to parameters.pyJason Gerard DeRose2009-01-141-0/+884