Skip to content

Commit

Permalink
failing test for #2
Browse files Browse the repository at this point in the history
  • Loading branch information
wimglenn committed Feb 26, 2018
1 parent 05856d9 commit fc283f4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test_oyaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,38 @@ def test_loads_to_std_dict():
loaded = yaml.load('{k1: v1, k3: v3, k2: v2}')
assert not isinstance(loaded, OrderedDict)
assert isinstance(loaded, dict)


def test_anchors_and_references():
text = '''
defaults:
all: &all
product: foo
development: &development
<<: *all
profile: bar
development:
platform:
<<: *development
host: baz
'''
expected_load = {
'defaults': {
'all': {
'product': 'foo',
},
'development': {
'product': 'foo',
'profile': 'bar',
},
},
'development': {
'platform': {
'host': 'baz',
'product': 'foo',
'profile': 'bar',
},
},
}
assert yaml.load(text) == expected_load

0 comments on commit fc283f4

Please sign in to comment.