Ignore:
Timestamp:
04/21/06 13:31:29 (9 years ago)
Author:
xi
Message:

Fix !!python/name for Python 2.3. Clear the yaml module namespace.

File:
1 edited

Legend:

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

    r136 r146  
    142142TestResolver.add_tests('testResolver', '.data', '.canonical') 
    143143 
    144 class MyConstructor: 
    145  
     144class MyLoader(Loader): 
    146145    def construct_sequence(self, node): 
    147         return tuple(Constructor.construct_sequence(self, node)) 
     146        return tuple(Loader.construct_sequence(self, node)) 
    148147 
    149148    def construct_mapping(self, node): 
     
    155154        return self.construct_scalar(node) 
    156155 
    157 class MyLoader(MyConstructor, Loader): 
    158     pass 
    159156MyLoader.add_constructor(None, MyLoader.construct_undefined) 
    160157 
    161 class MyCanonicalLoader(MyConstructor, test_appliance.CanonicalLoader): 
    162     pass 
     158class MyCanonicalLoader(test_appliance.CanonicalLoader): 
     159 
     160    def construct_sequence(self, node): 
     161        return tuple(test_appliance.CanonicalLoader.construct_sequence(self, node)) 
     162 
     163    def construct_mapping(self, node): 
     164        pairs = self.construct_pairs(node) 
     165        pairs.sort() 
     166        return pairs 
     167 
     168    def construct_undefined(self, node): 
     169        return self.construct_scalar(node) 
     170 
    163171MyCanonicalLoader.add_constructor(None, MyCanonicalLoader.construct_undefined) 
    164172 
Note: See TracChangeset for help on using the changeset viewer.