Commit Graph

19 Commits

Author SHA1 Message Date
darrenburns
62fcefbd2d Validation (#2600)
* A few different types of validation

* Rename

* Fix test

* Updating validation framework

* Update lockfile

* Ensure validators can be None

* Reworking the API a little

* Convert Input.Changed to dataclass

* Add utility for getting failures as strings

* Update an example in Validator docstring

* Remove some redundant `pass`es

* Renaming variables

* Validating Input on submit, attaching result to Submitted event

* Testing various validation features

* Update snapshots and deps

* Styling unfocused -invalid Input differently

* Add snapshot test around input validation and associated styles

* Validation docs

* Tidying validation docs in Input widget reference

* Fix mypy issues

* Remove __bool__ from Failure, make validator field required

* Code review changes

* Improving error messages in Validators
2023-05-25 13:29:33 +01:00
Darren Burns
9287f64a66 Add isort pre-commit hook, sort imports in src and test directories 2023-02-09 13:28:08 +00:00
Dave Pearson
928a289c0e Add extra unit tests for password field deletion
Here we're just testing the exceptional situations.
2023-01-30 20:38:19 +00:00
Dave Pearson
5fc16c6af0 Add extra unit tests for password field movement
Here we're just testing the exceptional situations.
2023-01-30 20:34:22 +00:00
Dave Pearson
a1752248d4 Help some older Pythons along 2023-01-30 10:23:37 +00:00
Dave Pearson
9e23a79ec1 Add more Input unit tests for actions that modify the text
This time all the things to do with deleting right.
2023-01-30 10:15:23 +00:00
Dave Pearson
af2189fdeb Fix a docstring typo 2023-01-30 10:12:35 +00:00
Dave Pearson
e199dc226b Start Input unit tests for actions that modify the text 2023-01-30 09:51:46 +00:00
Dave Pearson
1230ca3694 Rename the key action tests
There are actions that relate to editing the input too, which I also want to
test, but I'm not minded to lump them all in the same file. So here I'm
renaming to make it clear these tests are just about movement. The editing
ones will come next in their own file.
2023-01-29 11:58:46 +00:00
Dave Pearson
b7203edd4a Add a test for using left-word to get home from the end of an input 2023-01-29 11:57:00 +00:00
Dave Pearson
054c23ab29 Add a test for using right-word to get to the end of an input 2023-01-29 11:53:21 +00:00
Dave Pearson
5bf0542e47 Rename a test to be more in line with the others 2023-01-29 11:49:29 +00:00
Dave Pearson
af4a6b0f68 Fix a typo/thinko in a test name 2023-01-29 11:48:48 +00:00
Dave Pearson
112c789e3c Add a test for going right a word from the end 2023-01-29 11:47:16 +00:00
Dave Pearson
d5a99425c0 Add a test for going right a word from the start 2023-01-29 11:37:12 +00:00
Dave Pearson
fad87c90f3 Add a test for going left a word from the end 2023-01-29 11:29:07 +00:00
Dave Pearson
938a3b4ed5 Add a test for going left a word from home
This should result in a NOP.
2023-01-29 11:20:44 +00:00
Dave Pearson
7ddf4bbecc Add some initial Input key/action unit tests
This is just getting a feel for how I'll go about testing these. The main
focus here won't be on the bindings themselves -- they're not really
interesting and I feel could change over time anyway as people's tastes
settle down. What I want to test here are the actions that get bound.

This is just an initial small set of what's going to be a much bigger
collection of Input action tests.
2023-01-27 18:42:38 +00:00
Dave Pearson
f4b29d8b99 Move the current Input tests into a subdirectory
I'm going to be adding more tests for Input, and I don't want to be doing
one large monolithic file of them, so this makes a space where
Input-targeting tests can live together and be easy to spot.
2023-01-27 18:41:13 +00:00