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

Revision 122, 567 bytes checked in by xi, 9 years ago (diff)

Add a skeleton of the emitter.

RevLine 
[122]1
2import test_appliance, sys
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        emitter = Emitter(writer)
12        print "-"*30
13        print "ORIGINAL DATA:"
14        print file(canonical_filename, 'rb').read()
15        for event in events:
16            emitter.emit(event)
17
18TestEmitterOnCanonical.add_tests('testEmitterOnCanonical', '.canonical')
19
Note: See TracBrowser for help on using the repository browser.