summaryrefslogtreecommitdiff
path: root/_test/test_fail.py
diff options
context:
space:
mode:
Diffstat (limited to '_test/test_fail.py')
-rw-r--r--_test/test_fail.py97
1 files changed, 71 insertions, 26 deletions
diff --git a/_test/test_fail.py b/_test/test_fail.py
index fb85e5f..9c318a0 100644
--- a/_test/test_fail.py
+++ b/_test/test_fail.py
@@ -15,7 +15,8 @@ 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?
@@ -24,11 +25,15 @@ 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?
@@ -37,7 +42,11 @@ class TestCommentFailures:
? b # You see? Promised you.
? c
# this is the end
- """)) == dedent("""
+ """
+ )
+ )
+ == dedent(
+ """
!!set
# or this one?
? a
@@ -45,15 +54,19 @@ 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 = """
@@ -63,18 +76,20 @@ 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]
@@ -95,10 +110,14 @@ 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]
@@ -119,7 +138,12 @@ 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]
@@ -140,46 +164,67 @@ 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,
+ )