Ignore:
Timestamp:
09/02/13 11:05:25 (8 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Phase:
public
Rebase:
38323238613265633737366534633963326263633366393564373333653762656537363239643735
Message:

Support a common stylistic variation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/tests/test_yamlish.py

    r102 r103  
    88
    99from nagslang.yamlish import load, dump
     10
     11
     12class TestParse(TestCase):
     13    def assertParsesAs(self, yaml, expected):
     14        f = StringIO(yaml.strip())
     15        self.assertEqual(load(f), expected)
     16
     17    def test_dict_list_1(self):
     18        self.assertParsesAs('''
     19foo:
     20- bar
     21- baz
     22        ''', {'foo': ['bar', 'baz']})
     23
     24    def test_dict_list_2(self):
     25        self.assertParsesAs('''
     26foo:
     27  - bar
     28  - baz
     29        ''', {'foo': ['bar', 'baz']})
    1030
    1131
Note: See TracChangeset for help on using the changeset viewer.