diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-02-16 16:24:51 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-02-16 16:24:51 +0100 |
commit | 7d08baca38827b59af9592e415bc4778fb8c4958 (patch) | |
tree | f6ad4a356235367d6a741d197e04f619f65c70a2 /yamlish.py | |
parent | d7e73ec4c238d0eb1c5493bb90c022d683123296 (diff) | |
download | yamlish-7d08baca38827b59af9592e415bc4778fb8c4958.tar.gz |
Start building tests.
Diffstat (limited to 'yamlish.py')
-rw-r--r-- | yamlish.py | 76 |
1 files changed, 76 insertions, 0 deletions
@@ -1 +1,77 @@ # -*- coding: utf-8 -*- + +import yaml +import pprint + +IN = """ +--- +bill-to: + address: + city: "Royal Oak" + lines: "458 Walkman Dr.\nSuite #292\n" + postal: 48046 + state: MI + family: Dumars + given: Chris +comments: "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n" +date: 2001-01-23 +invoice: 34843 +product: + - + description: Basketball + price: 450.00 + quantity: 4 + sku: BL394D + - + description: "Super Hoop" + price: 2392.00 + quantity: 1 + sku: BL4438H +tax: 251.42 +total: 4443.52 +... +""" + +OUT = { + 'bill-to': { + 'given': 'Chris', + 'address': { + 'city': 'Royal Oak', + 'postal': '48046', + 'lines': "458 Walkman Dr.\nSuite #292\n", + 'state': 'MI' + }, + 'family': 'Dumars' + }, + 'invoice': '34843', + 'date': '2001-01-23', + 'tax': '251.42', + 'product': [ + { + 'sku': 'BL394D', + 'quantity': '4', + 'price': '450.00', + 'description': 'Basketball' + }, + { + 'sku': 'BL4438H', + 'quantity': '1', + 'price': '2392.00', + 'description': 'Super Hoop' + } + ], + 'comments': + "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n", + 'total': '4443.52' +} + +class Reader(object): + def __init__(self): + pass + + def read(self, source): + pass + +#print yaml.dump(OUT, canonical=False, default_flow_style=False, default_style=False) +def read(): + pass |