summaryrefslogtreecommitdiff
path: root/_test/test_fail.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-05 17:05:06 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-05 17:05:06 +0200
commite58ed78b291889578477741fb5ad5f05bf914d6b (patch)
tree73fa7be33210f4e9ee033f662486643e041dfdd0 /_test/test_fail.py
parent992aecee297f7fe781eddc715fff6d7f5bbed875 (diff)
downloadruamel.yaml-e58ed78b291889578477741fb5ad5f05bf914d6b.tar.gz
undid miswrapping of tests
Diffstat (limited to '_test/test_fail.py')
-rw-r--r--_test/test_fail.py96
1 files changed, 25 insertions, 71 deletions
diff --git a/_test/test_fail.py b/_test/test_fail.py
index 9c318a0..2f0b37a 100644
--- a/_test/test_fail.py
+++ b/_test/test_fail.py
@@ -15,8 +15,7 @@ class TestCommentFailures:
@pytest.mark.xfail(strict=True)
def test_set_comment_before_tag(self):
# no comments before tags
- round_trip(
- """
+ round_trip("""
# the beginning
!!set
# or this one?
@@ -25,15 +24,11 @@ class TestCommentFailures:
? b # You see? Promised you.
? c
# this is the end
- """
- )
+ """)
def test_set_comment_before_tag_no_fail(self):
# no comments before tags
- assert (
- round_trip_dump(
- round_trip_load(
- """
+ assert round_trip_dump(round_trip_load("""
# the beginning
!!set
# or this one?
@@ -42,11 +37,7 @@ class TestCommentFailures:
? b # You see? Promised you.
? c
# this is the end
- """
- )
- )
- == dedent(
- """
+ """)) == dedent("""
!!set
# or this one?
? a
@@ -54,19 +45,15 @@ class TestCommentFailures:
? b # You see? Promised you.
? c
# this is the end
- """
- )
- )
+ """)
@pytest.mark.xfail(strict=True)
def test_comment_dash_line(self):
- round_trip(
- """
+ round_trip("""
- # abc
a: 1
b: 2
- """
- )
+ """)
def test_comment_dash_line_fail(self):
x = """
@@ -76,20 +63,17 @@ class TestCommentFailures:
"""
data = round_trip_load(x)
# this is not nice
- assert round_trip_dump(data) == dedent(
- """
+ assert round_trip_dump(data) == dedent("""
# abc
- a: 1
b: 2
- """
- )
+ """)
class TestIndentFailures:
@pytest.mark.xfail(strict=True)
def test_indent_not_retained(self):
- round_trip(
- """
+ round_trip("""
verbosity: 1 # 0 is minimal output, -1 none
base_url: http://gopher.net
special_indices: [1, 5, 8]
@@ -110,14 +94,10 @@ class TestIndentFailures:
Italy: Rome
Antarctica:
- too cold
- """
- )
+ """)
def test_indent_not_retained_no_fail(self):
- assert (
- round_trip_dump(
- round_trip_load(
- """
+ assert round_trip_dump(round_trip_load("""
verbosity: 1 # 0 is minimal output, -1 none
base_url: http://gopher.net
special_indices: [1, 5, 8]
@@ -138,12 +118,7 @@ class TestIndentFailures:
Italy: Rome
Antarctica:
- too cold
- """
- ),
- indent=4,
- )
- == dedent(
- """
+ """), indent=4) == dedent("""
verbosity: 1 # 0 is minimal output, -1 none
base_url: http://gopher.net
special_indices: [1, 5, 8]
@@ -164,67 +139,46 @@ class TestIndentFailures:
Italy: Rome
Antarctica:
- too cold
- """
- )
- )
+ """)
def Xtest_indent_top_level_no_fail(self):
- round_trip(
- """
+ round_trip("""
- a:
- b
- """,
- indent=4,
- )
+ """, indent=4)
class TestTagFailures:
@pytest.mark.xfail(strict=True)
def test_standard_short_tag(self):
- round_trip(
- """\
+ round_trip("""\
!!map
name: Anthon
location: Germany
language: python
- """
- )
+ """)
def test_standard_short_tag_no_fail(self):
- assert (
- round_trip_dump(
- round_trip_load(
- """
+ assert round_trip_dump(round_trip_load("""
!!map
name: Anthon
location: Germany
language: python
- """
- )
- )
- == dedent(
- """
+ """)) == dedent("""
name: Anthon
location: Germany
language: python
- """
- )
- )
+ """)
class TestFlowValues:
def test_flow_value_with_colon(self):
- round_trip(
- """\
+ round_trip("""\
{a: bcd:efg}
- """
- )
+ """)
# @pytest.mark.xfail(strict=True)
def test_flow_value_with_colon_quoted(self):
- round_trip(
- """\
+ round_trip("""\
{a: 'bcd:efg'}
- """,
- preserve_quotes=True,
- )
+ """, preserve_quotes=True)