Kirill Simonov avatar Kirill Simonov committed 19493c1

Rename error-message to loader-error and add new examples.

Comments (0)

Files changed (149)

tests/data/document-separator-in-quoted-scalar.error-message

----
-"this --- is correct"
----
-"this
-...is also
-correct"
----
-"a quoted scalar
-cannot contain
----
-document separators"

tests/data/document-separator-in-quoted-scalar.loader-error

+---
+"this --- is correct"
+---
+"this
+...is also
+correct"
+---
+"a quoted scalar
+cannot contain
+---
+document separators"

tests/data/duplicate-anchor-1.error-message

-- &foo bar
-- &bar bar
-- &foo bar

tests/data/duplicate-anchor-1.loader-error

+- &foo bar
+- &bar bar
+- &foo bar

tests/data/duplicate-anchor-2.error-message

-&foo [1, 2, 3, &foo 4]

tests/data/duplicate-anchor-2.loader-error

+&foo [1, 2, 3, &foo 4]

tests/data/duplicate-key.error-message

----
-foo: bar
-foo: baz

tests/data/duplicate-key.loader-error

+---
+foo: bar
+foo: baz

tests/data/duplicate-mapping-key.error-message

----
-&anchor foo:
-    foo: bar
-    *anchor: duplicate key
-    baz: bat
-    *anchor: duplicate key

tests/data/duplicate-mapping-key.loader-error

+---
+&anchor foo:
+    foo: bar
+    *anchor: duplicate key
+    baz: bat
+    *anchor: duplicate key

tests/data/duplicate-merge-key.error-message

----
-<<: {x: 1, y: 2}
-foo: bar
-<<: {z: 3, t: 4}

tests/data/duplicate-merge-key.loader-error

+---
+<<: {x: 1, y: 2}
+foo: bar
+<<: {z: 3, t: 4}

tests/data/duplicate-tag-directive.error-message

-%TAG    !foo!   bar
-%TAG    !foo!   baz
---- foo

tests/data/duplicate-tag-directive.loader-error

+%TAG    !foo!   bar
+%TAG    !foo!   baz
+--- foo

tests/data/duplicate-value-key.error-message

----
-=: 1
-foo: bar
-=: 2

tests/data/duplicate-value-key.loader-error

+---
+=: 1
+foo: bar
+=: 2

tests/data/duplicate-yaml-directive.error-message

-%YAML   1.1
-%YAML   1.1
---- foo

tests/data/duplicate-yaml-directive.loader-error

+%YAML   1.1
+%YAML   1.1
+--- foo

tests/data/empty-python-module.loader-error

+--- !!python:module:

tests/data/empty-python-name.loader-error

+--- !!python/name: empty

tests/data/expected-mapping.error-message

---- !!map [not, a, map]

tests/data/expected-mapping.loader-error

+--- !!map [not, a, map]

tests/data/expected-scalar.error-message

---- !!str [not a scalar]

tests/data/expected-scalar.loader-error

+--- !!str [not a scalar]

tests/data/expected-sequence.error-message

---- !!seq {foo, bar, baz}

tests/data/expected-sequence.loader-error

+--- !!seq {foo, bar, baz}

tests/data/forbidden-entry.error-message

-test: - foo
-      - bar

tests/data/forbidden-entry.loader-error

+test: - foo
+      - bar

tests/data/forbidden-key.error-message

-test: ? foo
-      : bar

tests/data/forbidden-key.loader-error

+test: ? foo
+      : bar

tests/data/forbidden-value.error-message

-test: key: value

tests/data/forbidden-value.loader-error

+test: key: value

tests/data/invalid-anchor-1.error-message

---- &?  foo # we allow only ascii and numeric characters in anchor names.

tests/data/invalid-anchor-1.loader-error

+--- &?  foo # we allow only ascii and numeric characters in anchor names.

tests/data/invalid-anchor-2.error-message

----
-- [
-    &correct foo,
-    *correct,
-    *correct]   # still correct
-- *correct: still correct
-- &correct-or-not[foo, bar]
-

tests/data/invalid-anchor-2.loader-error

+---
+- [
+    &correct foo,
+    *correct,
+    *correct]   # still correct
+- *correct: still correct
+- &correct-or-not[foo, bar]
+

tests/data/invalid-base64-data.error-message

---- !!binary
-    binary data encoded in base64 should be here.

tests/data/invalid-base64-data.loader-error

+--- !!binary
+    binary data encoded in base64 should be here.

tests/data/invalid-block-scalar-indicator.error-message

---- > what is this?  # a comment
-data

tests/data/invalid-block-scalar-indicator.loader-error

+--- > what is this?  # a comment
+data
Add a comment to this file

tests/data/invalid-character.error-message

Binary file removed.

Add a comment to this file

tests/data/invalid-character.loader-error

Binary file added.

tests/data/invalid-directive-line.error-message

-%YAML   1.1 ?   # extra symbol
----

tests/data/invalid-directive-line.loader-error

+%YAML   1.1 ?   # extra symbol
+---

tests/data/invalid-directive-name-1.error-message

-%   # no name at all
----

tests/data/invalid-directive-name-1.loader-error

+%   # no name at all
+---

tests/data/invalid-directive-name-2.error-message

-%invalid-characters:in-directive name
----

tests/data/invalid-directive-name-2.loader-error

+%invalid-characters:in-directive name
+---

tests/data/invalid-escape-character.error-message

-"some escape characters are \ncorrect, but this one \?\nis not\n"

tests/data/invalid-escape-character.loader-error

+"some escape characters are \ncorrect, but this one \?\nis not\n"

tests/data/invalid-escape-numbers.error-message

-"hm.... \u123?"

tests/data/invalid-escape-numbers.loader-error

+"hm.... \u123?"

tests/data/invalid-indentation-indicator-1.error-message

---- >0  # not valid
-data

tests/data/invalid-indentation-indicator-1.loader-error

+--- >0  # not valid
+data

tests/data/invalid-indentation-indicator-2.error-message

---- >-0
-data

tests/data/invalid-indentation-indicator-2.loader-error

+--- >-0
+data

tests/data/invalid-merge-1.error-message

-foo: bar
-<<: baz

tests/data/invalid-merge-1.loader-error

+foo: bar
+<<: baz

tests/data/invalid-merge-2.error-message

-foo: bar
-<<: [x: 1, y: 2, z, t: 4]

tests/data/invalid-merge-2.loader-error

+foo: bar
+<<: [x: 1, y: 2, z, t: 4]

tests/data/invalid-omap-1.error-message

---- !!omap
-foo: bar
-baz: bat

tests/data/invalid-omap-1.loader-error

+--- !!omap
+foo: bar
+baz: bat

tests/data/invalid-omap-2.error-message

---- !!omap
-- foo: bar
-- baz

tests/data/invalid-omap-2.loader-error

+--- !!omap
+- foo: bar
+- baz

tests/data/invalid-omap-3.error-message

---- !!omap
-- foo: bar
-- baz: bar
-  bar: bar

tests/data/invalid-omap-3.loader-error

+--- !!omap
+- foo: bar
+- baz: bar
+  bar: bar

tests/data/invalid-pairs-1.error-message

---- !!pairs
-foo: bar
-baz: bat

tests/data/invalid-pairs-1.loader-error

+--- !!pairs
+foo: bar
+baz: bat

tests/data/invalid-pairs-2.error-message

---- !!pairs
-- foo: bar
-- baz

tests/data/invalid-pairs-2.loader-error

+--- !!pairs
+- foo: bar
+- baz

tests/data/invalid-pairs-3.error-message

---- !!pairs
-- foo: bar
-- baz: bar
-  bar: bar

tests/data/invalid-pairs-3.loader-error

+--- !!pairs
+- foo: bar
+- baz: bar
+  bar: bar

tests/data/invalid-python-module-kind.loader-error

+--- !!python/module:sys { must, be, scalar }

tests/data/invalid-python-module-value.loader-error

+--- !!python/module:sys "non-empty value"

tests/data/invalid-python-module.loader-error

+--- !!python/module:no.such.module

tests/data/invalid-python-name-kind.loader-error

+--- !!python/name:sys.modules {}

tests/data/invalid-python-name-module-2.loader-error

+--- !!python/name:xml.parsers

tests/data/invalid-python-name-module.loader-error

+--- !!python/name:sys.modules.keys

tests/data/invalid-python-name-object.loader-error

+--- !!python/name:os.path.rm_rf

tests/data/invalid-python-name-value.loader-error

+--- !!python/name:sys.modules 5

tests/data/invalid-simple-key.error-message

-key: value
-invalid simple key
-next key: next value

tests/data/invalid-simple-key.loader-error

+key: value
+invalid simple key
+next key: next value

tests/data/invalid-starting-character.error-message

-@@@@@@@@@@@@@@@@@@@

tests/data/invalid-starting-character.loader-error

+@@@@@@@@@@@@@@@@@@@

tests/data/invalid-tag-1.error-message

-- !<foo#bar> baz

tests/data/invalid-tag-1.loader-error

+- !<foo#bar> baz

tests/data/invalid-tag-2.error-message

-- !prefix!foo#bar baz

tests/data/invalid-tag-2.loader-error

+- !prefix!foo#bar baz

tests/data/invalid-tag-directive-handle.error-message

-%TAG !!! !!!
----

tests/data/invalid-tag-directive-handle.loader-error

+%TAG !!! !!!
+---

tests/data/invalid-tag-directive-prefix.error-message

-%TAG    !   tag:zz.com/foo#bar  # '#' is not allowed in URLs
----

tests/data/invalid-tag-directive-prefix.loader-error

+%TAG    !   tag:zz.com/foo#bar  # '#' is not allowed in URLs
+---

tests/data/invalid-tag-handle-1.error-message

-%TAG    foo bar
----

tests/data/invalid-tag-handle-1.loader-error

+%TAG    foo bar
+---

tests/data/invalid-tag-handle-2.error-message

-%TAG    !foo    bar
----

tests/data/invalid-tag-handle-2.loader-error

+%TAG    !foo    bar
+---

tests/data/invalid-uri-escapes-1.error-message

---- !<tag:%x?y> foo

tests/data/invalid-uri-escapes-1.loader-error

+--- !<tag:%x?y> foo

tests/data/invalid-uri-escapes-2.error-message

---- !<%FF> foo

tests/data/invalid-uri-escapes-2.loader-error

+--- !<%FF> foo

tests/data/invalid-uri-escapes-3.error-message

---- !<foo%d0%af%d0%af%d0bar> baz

tests/data/invalid-uri-escapes-3.loader-error

+--- !<foo%d0%af%d0%af%d0bar> baz

tests/data/invalid-uri.error-message

---- !foo!   bar

tests/data/invalid-uri.loader-error

+--- !foo!   bar

tests/data/invalid-utf8-byte.error-message

--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
-Invalid byte ('\xFF'): � <--
--------------------------------------------------------------------------------------------------------------------------------

tests/data/invalid-utf8-byte.loader-error

+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------
+Invalid byte ('\xFF'): � <--
+-------------------------------------------------------------------------------------------------------------------------------

tests/data/invalid-yaml-directive-version-1.error-message

-# No version at all.
-%YAML
----

tests/data/invalid-yaml-directive-version-1.loader-error

+# No version at all.
+%YAML
+---

tests/data/invalid-yaml-directive-version-2.error-message

-%YAML   1e-5
----

tests/data/invalid-yaml-directive-version-2.loader-error

+%YAML   1e-5
+---

tests/data/invalid-yaml-directive-version-3.error-message

-%YAML 1.
----

tests/data/invalid-yaml-directive-version-3.loader-error

+%YAML 1.
+---

tests/data/invalid-yaml-directive-version-4.error-message

-%YAML 1.132.435
----

tests/data/invalid-yaml-directive-version-4.loader-error

+%YAML 1.132.435
+---

tests/data/invalid-yaml-directive-version-5.error-message

-%YAML A.0
----

tests/data/invalid-yaml-directive-version-5.loader-error

+%YAML A.0
+---

tests/data/invalid-yaml-directive-version-6.error-message

-%YAML 123.C
----

tests/data/invalid-yaml-directive-version-6.loader-error

+%YAML 123.C
+---

tests/data/invalid-yaml-version.error-message

-%YAML   2.0
---- foo

tests/data/invalid-yaml-version.loader-error

+%YAML   2.0
+--- foo

tests/data/no-block-collection-end.error-message

-- foo
-- bar
-baz: bar

tests/data/no-block-collection-end.loader-error

+- foo
+- bar
+baz: bar

tests/data/no-block-mapping-end.error-message

-foo: "bar" "baz"

tests/data/no-block-mapping-end.loader-error

+foo: "bar" "baz"

tests/data/no-document-start.error-message

-%YAML   1.1
-# no ---
-foo: bar

tests/data/no-document-start.loader-error

+%YAML   1.1
+# no ---
+foo: bar

tests/data/no-flow-mapping-end.error-message

-{ foo: bar ]

tests/data/no-flow-mapping-end.loader-error

+{ foo: bar ]

tests/data/no-flow-sequence-end.error-message

-[foo, bar}

tests/data/no-flow-sequence-end.loader-error

+[foo, bar}

tests/data/no-node-1.error-message

-- !foo ]

tests/data/no-node-1.loader-error

+- !foo ]

tests/data/no-node-2.error-message

-- [ !foo } ]

tests/data/no-node-2.loader-error

+- [ !foo } ]

tests/data/recursive-anchor.error-message

-- &foo [1
-    2,
-    3,
-    *foo]

tests/data/recursive-anchor.loader-error

+- &foo [1
+    2,
+    3,
+    *foo]

tests/data/unacceptable-key.error-message

----
-? - foo
-  - bar
-: baz

tests/data/unacceptable-key.loader-error

+---
+? - foo
+  - bar
+: baz

tests/data/unclosed-bracket.error-message

-test:
-    - [ foo: bar
-# comment the rest of the stream to let the scanner detect the problem.
-#    - baz
-#"we could have detected the unclosed bracket on the above line, but this would forbid such syntax as": {
-#}

tests/data/unclosed-bracket.loader-error

+test:
+    - [ foo: bar
+# comment the rest of the stream to let the scanner detect the problem.
+#    - baz
+#"we could have detected the unclosed bracket on the above line, but this would forbid such syntax as": {
+#}

tests/data/unclosed-quoted-scalar.error-message

-'foo
- bar

tests/data/unclosed-quoted-scalar.loader-error

+'foo
+ bar

tests/data/undefined-anchor.error-message

-- foo
-- &bar baz
-- *bat

tests/data/undefined-anchor.loader-error

+- foo
+- &bar baz
+- *bat

tests/data/undefined-constructor.error-message

---- !foo bar

tests/data/undefined-constructor.loader-error

+--- !foo bar

tests/data/undefined-tag-handle.error-message

---- !foo!bar    baz

tests/data/undefined-tag-handle.loader-error

+--- !foo!bar    baz

tests/test_errors.py

 
 class TestErrors(test_appliance.TestAppliance):
 
-    def _testErrors(self, test_name, invalid_filename):
+    def _testLoaderErrors(self, test_name, invalid_filename):
         #self._load(invalid_filename)
         self.failUnlessRaises(YAMLError, lambda: self._load(invalid_filename))
 
-    def _testStringErrors(self, test_name, invalid_filename):
+    def _testLoaderStringErrors(self, test_name, invalid_filename):
         #self._load_string(invalid_filename)
         self.failUnlessRaises(YAMLError, lambda: self._load_string(invalid_filename))
 
             #print "%s:" % exc.__class__.__name__, exc
             raise
 
-TestErrors.add_tests('testErrors', '.error-message')
-TestErrors.add_tests('testStringErrors', '.error-message')
+TestErrors.add_tests('testLoaderErrors', '.loader-error')
+TestErrors.add_tests('testLoaderStringErrors', '.loader-error')
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.