Changeset 33 for trunk/airspeed_test.py
- Timestamp:
- 16/09/04 15:07:05 (8 years ago)
- Files:
-
- 1 modified
-
trunk/airspeed_test.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/airspeed_test.py
r32 r33 179 179 self.assertEquals("1296", template.merge(locals())) 180 180 181 def test_can_call_function_with_ one_parameter(self):181 def test_can_call_function_with_two_parameters(self): 182 182 def multiply(number1, number2): 183 183 return number1 * number2 … … 398 398 self.assertEquals(" $user.name ", template.merge({'user':MyObject()})) 399 399 400 def test_variables_expanded_in_double_quoted_strings(self): 401 template = airspeed.Template('#set($hello="hello, $name is my name")$hello') 402 self.assertEquals("hello, Steve is my name", template.merge({'name':'Steve'})) 403 404 def test_escaped_variable_references_not_expanded_in_double_quoted_strings(self): 405 template = airspeed.Template('#set($hello="hello, \\$name is my name")$hello') 406 self.assertEquals("hello, $name is my name", template.merge({'name':'Steve'})) 407 408 def test_macros_expanded_in_double_quoted_strings(self): 409 template = airspeed.Template('#macro(hi $person)$person says hello#end#set($hello="#hi($name)")$hello') 410 self.assertEquals("Steve says hello", template.merge({'name':'Steve'})) 411 400 412 # 401 413 # TODO: 402 414 # 415 # Report locations for template errors in strings 403 416 # Math expressions 404 417 # Gobbling up whitespace (tricky!) … … 406 419 # Bind #macro calls at compile time? 407 420 # #stop ? 408 # Interpolated strings -- what about \$ etc?409 # Directives inside string literals410 421 # map literals 411 422 # Sub-object assignment: #set( $customer.Behavior = $primate )
