Commit Graph

114 Commits

Author SHA1 Message Date
Tim Abbott d1760a1bb9 validators: Add check_float validator. 2017-03-23 21:23:41 -07:00
Tim Abbott b81fd407e8 mypy: Fix several Optional typing errors. 2017-02-10 23:53:44 -08:00
David Adamec 9e8ea93d3d Add annotations for zerver/lib/validator. 2016-06-03 23:53:49 -07:00
Umair Khan 08fbd57245 [i18n] Make error messages translatable.
Make all strings passing through `json_error` and `JsonableError`
translatable.

Fixes #727
2016-05-31 07:40:42 -07:00
Tim Abbott 41336f3782 lint-all: Check for use of '== None'. 2016-05-31 07:02:04 -07:00
Tim Abbott ee6062691a Fix missing None in check_none_or return. 2016-02-03 19:25:18 -08:00
Tim Abbott 651b011514 Apply Python 3 futurize transform libmodernize.fixes.fix_basestring. 2015-11-01 09:26:16 -08:00
Jason Michalski c17ed8dc8c Add bots to page_params and send events on bot creation
(imported from commit ce418b4f056576d57f82d26af621473c730c12d8)
2014-03-05 14:16:19 -05:00
Jessica McKellar 816c0a4393 Add a validator for arguments that are of a variable type.
We'll need this to validate subscription properties, which can be
strings or booleans.

(imported from commit 2572e334cd04ffe05151cba266e15a0ea7ae21c5)
2014-03-03 16:08:33 -05:00
Steve Howell 3d04f5f738 Use check_list instead of json_to_list.
(imported from commit 9ead12bc2a4744b94a747ca27054124aacde7ae4)
2014-02-18 13:02:08 -05:00
Steve Howell 7449079191 Validate schema of events in EventsRegisterTest.
For EventsRegisterTest that test updates to streams and
subscriptions, we now validate the events generated by
the actions under test conform to predicted schemas.

We define the schemas with help from the validators code
that is also sometimes used to validate incoming request
parameters for our views.

(imported from commit b4222b920a588e15cccee4a2349c074ca9697448)
2014-02-04 16:25:32 -05:00
Steve Howell be1857ceb3 Add blank line to check_list (cosmetic).
(imported from commit 20a9eed98846e976c7fa2cfdb43e25e1c43c850d)
2013-12-18 12:47:32 -05:00
Steve Howell 6f573feaeb Add "length" option to check_list validator.
(imported from commit 4f8e203f964d1c936fe548b2f77a2e4aae745ae9)
2013-12-18 12:45:29 -05:00
Steve Howell 4184b9d56f Add validators.py (with tests).
This sets up a scheme to validate complex data structures and
give specific error messages for improperly typed parameters.

(imported from commit 33b2f070d993da4ee929119dd41503bd0128c8eb)
2013-12-13 18:19:07 -05:00