source: pyyaml/branches/working-on-emitter/tests/test_emitter.py @ 127

Revision 127, 618 bytes checked in by xi, 9 years ago (diff)

Parser now provides style information. Allow empty plain scalars if a tag or anchor is given.

Line 
1
2import test_appliance, sys, StringIO
3
4from yaml import *
5
6class TestEmitterOnCanonical(test_appliance.TestAppliance):
7
8    def _testEmitterOnCanonical(self, test_name, canonical_filename):
9        events = list(iter(Parser(Scanner(Reader(file(canonical_filename, 'rb'))))))
10        #writer = sys.stdout
11        writer = StringIO.StringIO()
12        emitter = Emitter(writer)
13        #print "-"*30
14        #print "ORIGINAL DATA:"
15        #print file(canonical_filename, 'rb').read()
16        for event in events:
17            emitter.emit(event)
18
19TestEmitterOnCanonical.add_tests('testEmitterOnCanonical', '.canonical')
20
Note: See TracBrowser for help on using the repository browser.