summaryrefslogtreecommitdiff
path: root/tests/files/fail/test_sequence.yaml
blob: e26c4a2103a45c45d9e8f946ab78ec1419c3631c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
name: fail-sequence-1
desc: 
data:
  - 1
  - 2
  - 3
  - True
  - False
schema:
  type: seq
  sequence:
    - type: str
errors:
  - "Value '1' is not of type 'str'. Path: '/0'"
  - "Value '2' is not of type 'str'. Path: '/1'"
  - "Value '3' is not of type 'str'. Path: '/2'"
  - "Value 'True' is not of type 'str'. Path: '/3'"
  - "Value 'False' is not of type 'str'. Path: '/4'"
---
name: fail-sequence-2
desc: 
data:
  - True
  - False
  - 1
schema:
  type: seq
  sequence:
    - type: bool
errors:
  - "Value '1' is not of type 'bool'. Path: '/2'"
---
name: fail-sequence-3
desc: sequence test
schema:
  type: seq
  required: true
  sequence:
    - type: str
      required: true
data:
  - foo
  - bar
  -
  - baz
  - 100
errors:
  - "Value '100' is not of type 'str'. Path: '/4'"
  - "required.novalue : '/2'"
  ## Kwalify errors
  # - "Value 'None' is not of type 'str'. Path: '/2'"
  # :required_novalue   : (line 3)[/2] value required but none.
  # :type_unmatch       : (line 5)[/4] '100': not a string.
---
name: fail-sequence-4
desc: Test that very deep nested sequences fail when schema expected sequence but value was something else
schema:
  type: seq
  sequence:
    - type: seq
      sequence:
        - type: seq
          sequence:
            - type: seq
              sequence:
                - type: str
data:
  - - - 1
errors:
  - "Value '1' is not a list. Value path: '/0/0/0'"