Ignore:
Timestamp:
07/21/06 09:52:03 (8 years ago)
Author:
xi
Message:

Update libyaml bindings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/tests/test_yaml_ext.py

    r205 r209  
    1111class TestExtLoader(test_appliance.TestAppliance): 
    1212 
    13     def _testExtScanner(self, test_name, data_filename, canonical_filename): 
    14         data = file(data_filename, 'r').read() 
     13    def _testExtScannerFileInput(self, test_name, data_filename, canonical_filename): 
     14        self._testExtScanner(test_name, data_filename, canonical_filename, True) 
     15 
     16    def _testExtScanner(self, test_name, data_filename, canonical_filename, file_input=False): 
     17        if file_input: 
     18            data = file(data_filename, 'r') 
     19        else: 
     20            data = file(data_filename, 'r').read() 
    1521        tokens = list(yaml.scan(data)) 
    1622        ext_tokens = [] 
    1723        try: 
     24            if file_input: 
     25                data = file(data_filename, 'r') 
    1826            for token in yaml.scan(data, Loader=yaml.ExtLoader): 
    1927                ext_tokens.append(token) 
     
    6371 
    6472TestExtLoader.add_tests('testExtScanner', '.data', '.canonical') 
     73TestExtLoader.add_tests('testExtScannerFileInput', '.data', '.canonical') 
    6574TestExtLoader.add_tests('testExtParser', '.data', '.canonical') 
    6675 
Note: See TracChangeset for help on using the changeset viewer.