Changeset 32 for trunk

Show
Ignore:
Timestamp:
02/09/04 09:00:11 (8 years ago)
Author:
steve
Message:

fixed bug in "$a.b" when no "b" attr in "a", and "a" not a dict

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/airspeed.py

    • Property svn:eol-style set to native
    r31 r32  
    313313            except KeyError: result = None 
    314314            except TypeError: result = None 
     315            except AttributeError: result = None 
    315316        if result is None: 
    316317            return None ## TODO: an explicit 'not found' exception? 
  • trunk/airspeed_test.py

    • Property svn:eol-style set to native
    r31 r32  
    392392        template = airspeed.Template(" $user.name ") 
    393393        self.assertEquals(" $user.name ", template.merge({'user':self})) 
     394 
     395    def test_when_non_dictionary_object_does_not_contain_referenced_attribute_no_substitution_occurs(self): 
     396        class MyObject: pass 
     397        template = airspeed.Template(" $user.name ") 
     398        self.assertEquals(" $user.name ", template.merge({'user':MyObject()})) 
     399 
    394400# 
    395401# TODO: