Pau Espin Pedrol | 3063730 | 2020-05-06 21:11:02 +0200 | [diff] [blame] | 1 | ==== Testing dynamically generated schemas ==== |
| 2 | schema_case_01.conf: |
| 3 | {'foobar.prefix.handover.duration': 'duration', |
| 4 | 'foobar.prefix.handover.threshold': 'uint'} |
| 5 | validating tests[0] |
| 6 | Validation: OK |
| 7 | validating tests[1] |
| 8 | --- foobar.prefix.handover.duration: ERR: ValueError: Invalid duration value: '22kkk' |
| 9 | Validation: Error |
| 10 | validating tests[2] |
| 11 | Validation: OK |
| 12 | validating tests[3] |
| 13 | --- -: ERR: ValueError: config item not known: 'foobar.wrongprefix.handover.duration' |
| 14 | Validation: Error |
| 15 | validating tests[4] |
| 16 | --- -: ERR: ValueError: config item not known: 'foobar.wrongprefix.handover' |
| 17 | Validation: Error |
| 18 | validating tests[5] |
| 19 | Validation: OK |
| 20 | validating tests[6] |
| 21 | --- foobar.prefix.handover.threshold: ERR: ValueError: Positive value expected instead of -2 |
| 22 | Validation: Error |
| 23 | validating tests[7] |
| 24 | --- -: ERR: ValueError: config item not known: 'foobar.prefix.handover[].threshold' |
| 25 | Validation: Error |
| 26 | validating tests[8] |
| 27 | --- -: ERR: ValueError: config item is a list, should be 'uint': 'foobar.prefix.handover.threshold' |
| 28 | Validation: Error |
| 29 | ---------------------- |
| 30 | schema_case_02.conf: |
| 31 | {'foobar.prefix.hey.ho.letsgo[]': 'wrongtype'} |
| 32 | validating tests[0] |
| 33 | --- -: ERR: ValueError: unknown type 'wrongtype' at 'foobar.prefix.hey.ho.letsgo[]' |
| 34 | Validation: Error |
| 35 | ---------------------- |
| 36 | schema_case_03.conf: |
| 37 | --- -: ERR: AssertionError: |
| 38 | config2schema: Error |
| 39 | ---------------------- |
| 40 | schema_case_04.conf: |
| 41 | --- -: ERR: AssertionError: |
| 42 | config2schema: Error |
| 43 | ---------------------- |
| 44 | schema_case_05.conf: |
| 45 | {'foobar.prefix.hey.ho.letsgo[]': 'str'} |
| 46 | validating tests[0] |
| 47 | Validation: OK |
| 48 | validating tests[1] |
| 49 | Validation: OK |
| 50 | validating tests[2] |
| 51 | Validation: OK |
| 52 | validating tests[3] |
| 53 | --- -: ERR: ValueError: config item not known: 'foobar.prefix.hey.ho.letsgo' |
| 54 | Validation: Error |
| 55 | validating tests[4] |
| 56 | Validation: OK |
| 57 | validating tests[5] |
| 58 | --- -: ERR: ValueError: config item is dict but should be a leaf node of type 'str': 'foobar.prefix.hey.ho.letsgo[]' |
| 59 | Validation: Error |
| 60 | validating tests[6] |
| 61 | --- -: ERR: ValueError: config item is a list, should be 'str': 'foobar.prefix.hey.ho.letsgo[]' |
| 62 | Validation: Error |
| 63 | ---------------------- |
Pau Espin Pedrol | d79e719 | 2020-05-21 15:40:57 +0200 | [diff] [blame] | 64 | schema_case_06.conf: |
| 65 | {'foobar.prefix.handover.anothervar': 'another_type', |
| 66 | 'foobar.prefix.handover.myvar': 'test_type', |
| 67 | 'foobar.prefix.handover.threshold': 'uint'} |
| 68 | validating tests[0] |
| 69 | Validation: OK |
| 70 | validating tests[1] |
| 71 | Validation: OK |
| 72 | validating tests[2] |
| 73 | Validation: OK |
| 74 | validating tests[3] |
| 75 | --- foobar.prefix.handover.myvar: ERR: ValueError: Invalid value 'invalid_val' for schema type 'test_type' (validator: test_validator) |
| 76 | Validation: Error |
| 77 | validating tests[4] |
| 78 | --- foobar.prefix.handover.anothervar: ERR: ValueError: Invalid value 'another_invalid_val' for schema type 'another_type' (validator: <lambda>) |
| 79 | Validation: Error |
| 80 | ---------------------- |