summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2023-05-09 19:57:35 +0200
committerAnthon van der Neut <anthon@mnt.org>2023-05-09 19:57:35 +0200
commitaccf77e5f97bd55fe62c67b3cc9bfdaad15dd6f3 (patch)
treec67a1b907c7b97d55dab46268b8b27438cb18bbe /_test
parent31986190f69f68b454260f8c9a04d8697a476d15 (diff)
downloadruamel.yaml-accf77e5f97bd55fe62c67b3cc9bfdaad15dd6f3.tar.gz
fix issue: 4590.17.25
Diffstat (limited to '_test')
-rw-r--r--_test/test_issues.py48
1 files changed, 46 insertions, 2 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index eadf94d..f0a7ede 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -957,7 +957,7 @@ class TestIssues:
def test_issue_447(self) -> None:
from ruamel.yaml import YAML
- YAML().load("{\n\t\"FOO\": \"BAR\"\n}")
+ YAML().load('{\n\t"FOO": "BAR"\n}')
def test_issue_449(self) -> None:
inp = """\
@@ -1039,11 +1039,55 @@ class TestIssues:
yaml = YAML()
out_stream = StringIO()
- in_string = "a" * 128
+ in_string = 'a' * 128
yaml.dump(in_string, out_stream)
result = out_stream.getvalue()
assert in_string == result.splitlines()[0]
+ def test_issue_459(self) -> None:
+ from io import StringIO
+ from ruamel.yaml import YAML
+
+ MYOBJ = {
+ 'data': dedent(
+ """\
+ example: "first"
+ data:
+ - flag: true
+ integer: 1
+ float: 1.0
+ string: "this is a string"
+ list:
+ - first
+ - second
+ - third
+ circle:
+ x: 10cm
+ y: 10cm
+ radius: 2.24cm
+
+ - flag: false
+ integer: 2
+ float: 2.0
+ string: "this is another string"
+ list:
+ - first
+ - second
+ - third
+ circle:
+ x: 20cm
+ y: 20cm
+ radius: 2.24cm
+ """
+ )
+ }
+ yaml = YAML()
+ yaml.width = 60
+ out_stream = StringIO()
+ yaml.dump([MYOBJ], out_stream)
+ data = yaml.load(out_stream.getvalue())
+ assert data[0]['data'] == MYOBJ['data']
+
# @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
# def test_issue_ xxx(self) -> None: