diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-06-24 07:18:46 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-06-24 07:18:46 +0200 |
commit | 325d9d4f536aad2f1ee2f0cd74d61791b3561fac (patch) | |
tree | e3dc7cb1b883d339d2cf33f02c5de026f9b47a81 /_test/test_anchor.py | |
parent | 84b55be25f6969f4df3a3ad7badad7bde6da1dc0 (diff) | |
download | ruamel.yaml-325d9d4f536aad2f1ee2f0cd74d61791b3561fac.tar.gz |
fix issue #130: regression in nested merges
Diffstat (limited to '_test/test_anchor.py')
-rw-r--r-- | _test/test_anchor.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/_test/test_anchor.py b/_test/test_anchor.py index fc4a881..47c9f94 100644 --- a/_test/test_anchor.py +++ b/_test/test_anchor.py @@ -244,6 +244,29 @@ class TestAnchorsAliases: with pytest.warns(ReusedAnchorWarning): data = round_trip(yaml) # NOQA + def test_issue_130(self): + # issue 130 reported by Devid Fee + import ruamel.yaml + ys = dedent("""\ + components: + server: &server_component + type: spark.server:ServerComponent + host: 0.0.0.0 + port: 8000 + shell: &shell_component + type: spark.shell:ShellComponent + + services: + server: &server_service + <<: *server_component + shell: &shell_service + <<: *shell_component + components: + server: {<<: *server_service} + """) + data = ruamel.yaml.safe_load(ys) + assert data['services']['shell']['components']['server']['port'] == 8000 + class TestMergeKeysValues: |