diff options
Diffstat (limited to 'tests/files/fail')
-rw-r--r-- | tests/files/fail/test_enum.yaml | 6 | ||||
-rw-r--r-- | tests/files/fail/test_mapping.yaml | 2 | ||||
-rw-r--r-- | tests/files/fail/test_type_email.yaml | 10 | ||||
-rw-r--r-- | tests/files/fail/test_type_float.yaml | 2 | ||||
-rw-r--r-- | tests/files/fail/test_type_url.yaml | 11 |
5 files changed, 25 insertions, 6 deletions
diff --git a/tests/files/fail/test_enum.yaml b/tests/files/fail/test_enum.yaml index 9f619dc..ba223e3 100644 --- a/tests/files/fail/test_enum.yaml +++ b/tests/files/fail/test_enum.yaml @@ -11,6 +11,6 @@ schema: - type: str enum: [E, F, G, H] errors: - - "Enum 'A' does not exist. Path: '/0'" - - "Enum 'B' does not exist. Path: '/1'" - - "Enum 'O' does not exist. Path: '/2'" + - "Enum 'A' does not exist. Path: '/0' Enum: ['E', 'F', 'G', 'H']" + - "Enum 'B' does not exist. Path: '/1' Enum: ['E', 'F', 'G', 'H']" + - "Enum 'O' does not exist. Path: '/2' Enum: ['E', 'F', 'G', 'H']" diff --git a/tests/files/fail/test_mapping.yaml b/tests/files/fail/test_mapping.yaml index 0561ea4..88b390f 100644 --- a/tests/files/fail/test_mapping.yaml +++ b/tests/files/fail/test_mapping.yaml @@ -158,7 +158,7 @@ data: birth: Jul 01, 1985 errors: - "Cannot find required key 'name'. Path: ''" - - "Enum 'ab' does not exist. Path: '/blood'" + - "Enum 'ab' does not exist. Path: '/blood' Enum: ['A', 'B', 'O', 'AB']" - "Key 'nam' was not defined. Path: ''" - "Value 'foo(at)mail.com' does not match pattern '.+@.+'. Path: '/email'" - "Value 'twenty' is not of type 'int'. Path: '/age'" diff --git a/tests/files/fail/test_type_email.yaml b/tests/files/fail/test_type_email.yaml new file mode 100644 index 0000000..9c8c18f --- /dev/null +++ b/tests/files/fail/test_type_email.yaml @@ -0,0 +1,10 @@ +--- +name: email-1 +desc: basic email type validation. Fails if not conforms with RFC 5322 Official Standard +# +schema: + type: email +data: + "foobar|gmail.com" +errors: + - "Value 'foobar|gmail.com' is not of type 'email'. Path: ''" diff --git a/tests/files/fail/test_type_float.yaml b/tests/files/fail/test_type_float.yaml index bef14b8..972167d 100644 --- a/tests/files/fail/test_type_float.yaml +++ b/tests/files/fail/test_type_float.yaml @@ -17,8 +17,6 @@ schema: seq: - type: float errors: - - "Value 'foo' is not of type 'float'. Path: '/0'" -errors: - "Value 'True' is not of type 'float'. Path: '/1'" - "Value 'foo' is not of type 'float'. Path: '/0'" --- diff --git a/tests/files/fail/test_type_url.yaml b/tests/files/fail/test_type_url.yaml new file mode 100644 index 0000000..1e79dfc --- /dev/null +++ b/tests/files/fail/test_type_url.yaml @@ -0,0 +1,11 @@ +--- +name: url2 +desc: basic url type validation. Fails as not confirms with RFC 1808 +# +schema: + type: url +# +data: + "www.google.com" +errors: + - "Value 'www.google.com' is not of type 'url'. Path: ''" |