summaryrefslogtreecommitdiff
path: root/tests/files/success/test_type_none.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/files/success/test_type_none.yaml')
-rw-r--r--tests/files/success/test_type_none.yaml47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/files/success/test_type_none.yaml b/tests/files/success/test_type_none.yaml
new file mode 100644
index 0000000..db65652
--- /dev/null
+++ b/tests/files/success/test_type_none.yaml
@@ -0,0 +1,47 @@
+#
+# NOTE: This case is not allowed becuase Core class do NOT allow
+# there is no data to validate. This happens if None is at top level
+# of the data structure.
+#
+# ---
+# name: type-none-1
+# desc: Most basic test for type None
+# data: ~
+# schema:
+# type: none
+---
+name: type-none-2
+desc: Test that none type works with none type as value in map
+data:
+ name: ~
+schema:
+ type: map
+ mapping:
+ name:
+ type: none
+---
+name: type-none-3
+desc: Test that none type works as value in sequence
+data:
+ - ~
+ - ~
+schema:
+ type: seq
+ sequence:
+ - type: none
+---
+name: type-none-4
+desc: Test that none type works inside nested map, seq, map
+data:
+ foo:
+ - bar: ~
+schema:
+ type: map
+ mapping:
+ foo:
+ type: seq
+ sequence:
+ - type: map
+ mapping:
+ bar:
+ type: none