diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-08-03 22:14:57 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-08-03 22:14:57 +0200 |
commit | dce10fcff1de54121fb8b440b883ef5d3fe2f96a (patch) | |
tree | 072b4bd247e6f1cd95c08c7b67fea0fc96f0578e /_test/test_copy.py | |
parent | 2966a4f215861fa05e0dc7e0cd53350766e794c6 (diff) | |
download | ruamel.yaml-dce10fcff1de54121fb8b440b883ef5d3fe2f96a.tar.gz |
Apply oitnb and mypy 0.620, then make everything work again0.15.48
Diffstat (limited to '_test/test_copy.py')
-rw-r--r-- | _test/test_copy.py | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/_test/test_copy.py b/_test/test_copy.py index 9a6deb0..a912259 100644 --- a/_test/test_copy.py +++ b/_test/test_copy.py @@ -6,16 +6,18 @@ Testing copy and deepcopy, instigated by Issue 84 (Peter Amstutz) import copy -import pytest # NOQA +import pytest # NOQA from roundtrip import dedent, round_trip_load, round_trip_dump class TestDeepCopy: def test_preserve_flow_style_simple(self): - x = dedent("""\ + x = dedent( + """\ {foo: bar, baz: quux} - """) + """ + ) data = round_trip_load(x) data_copy = copy.deepcopy(data) y = round_trip_dump(data_copy) @@ -25,9 +27,11 @@ class TestDeepCopy: assert data.fa.flow_style() == data_copy.fa.flow_style() def test_deepcopy_flow_style_nested_dict(self): - x = dedent("""\ + x = dedent( + """\ a: {foo: bar, baz: quux} - """) + """ + ) data = round_trip_load(x) assert data['a'].fa.flow_style() is True data_copy = copy.deepcopy(data) @@ -40,16 +44,20 @@ class TestDeepCopy: print('x [{}]'.format(x)) print('y [{}]'.format(y)) - assert y == dedent("""\ + assert y == dedent( + """\ a: foo: bar baz: quux - """) + """ + ) def test_deepcopy_flow_style_nested_list(self): - x = dedent("""\ + x = dedent( + """\ a: [1, 2, 3] - """) + """ + ) data = round_trip_load(x) assert data['a'].fa.flow_style() is True data_copy = copy.deepcopy(data) @@ -62,19 +70,23 @@ class TestDeepCopy: print('x [{}]'.format(x)) print('y [{}]'.format(y)) - assert y == dedent("""\ + assert y == dedent( + """\ a: - 1 - 2 - 3 - """) + """ + ) class TestCopy: def test_copy_flow_style_nested_dict(self): - x = dedent("""\ + x = dedent( + """\ a: {foo: bar, baz: quux} - """) + """ + ) data = round_trip_load(x) assert data['a'].fa.flow_style() is True data_copy = copy.copy(data) @@ -87,16 +99,20 @@ class TestCopy: z = round_trip_dump(data) assert y == z - assert y == dedent("""\ + assert y == dedent( + """\ a: foo: bar baz: quux - """) + """ + ) def test_copy_flow_style_nested_list(self): - x = dedent("""\ + x = dedent( + """\ a: [1, 2, 3] - """) + """ + ) data = round_trip_load(x) assert data['a'].fa.flow_style() is True data_copy = copy.copy(data) @@ -109,9 +125,11 @@ class TestCopy: print('x [{}]'.format(x)) print('y [{}]'.format(y)) - assert y == dedent("""\ + assert y == dedent( + """\ a: - 1 - 2 - 3 - """) + """ + ) |