src/cgelib/output/test_data/test_val_parse_fail.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | |
| 4 | class CustomValueParsers(): |
| 5 | |
| 6 | @staticmethod |
| 7 | def char64(val): |
| 8 | """ |
| 9 | Test val is exactely 64 characters. Can be anything that can be handled |
| 10 | by str() |
| 11 | """ |
| 12 | val = str(val) |
| 13 | if(len(val) != 64): |
| 14 | return ("This field expects a string of lenght 64 but the lenght " |
| 15 | "of the string is {}. The string is: {}" |
| 16 | .format(len(val), val)) |