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