source: branches/pyyaml3000/tests/test_canonical.py @ 51

Revision 51, 754 bytes checked in by xi, 9 years ago (diff)

Parser is done. Add iterator interfaces for Scanner and Parser.

RevLine 
[43]1
2import test_appliance
3
4class TestCanonicalAppliance(test_appliance.TestAppliance):
5
6    def _testCanonicalScanner(self, test_name, canonical_filename):
7        data = file(canonical_filename, 'rb').read()
[51]8        scanner = test_appliance.CanonicalScanner(data)
[43]9        tokens = scanner.scan()
[51]10        #for token in tokens:
11        #    print token
[43]12
13    def _testCanonicalParser(self, test_name, canonical_filename):
14        data = file(canonical_filename, 'rb').read()
[51]15        parser = test_appliance.CanonicalParser(data)
16        events = parser.parse()
17        #for event in events:
18        #    print event
[43]19
20TestCanonicalAppliance.add_tests('testCanonicalScanner', '.canonical')
21TestCanonicalAppliance.add_tests('testCanonicalParser', '.canonical')
22
Note: See TracBrowser for help on using the repository browser.