Changeset 1666 for trunk/pylucid/tests/test_plugin_api.py
- Timestamp:
- 07/10/08 13:37:49 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pylucid/tests/test_plugin_api.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/tests/test_plugin_api.py
r1646 r1666 204 204 # plugin model tables should be re-created, too. 205 205 install_plugin( 206 package_name, plugin_name, page_msg, verbosity=2, active=True 206 package_name, plugin_name, 207 page_msg, verbosity=2, user=None, active=True 207 208 ) 208 209 … … 281 282 ) 282 283 self.assertEqual2(args, "()") 283 self.assertEqual2(kwargs, "{'arg1': u'test1'}")284 285 def test_ tag_more_args(self):286 """ 287 More string kwargs284 self.assertEqual2(kwargs, "{'arg1': 'test1'}") 285 286 def test_numbers(self): 287 """ 288 Test string and numbers 288 289 """ 289 290 args, kwargs = self._get_args_info( 290 '{% lucidTag unittest_plugin a="0" b= "1" c="2"%}'291 '{% lucidTag unittest_plugin a="0" b=1 c=2 %}' 291 292 ) 292 293 self.assertEqual2(args, "()") 293 self.assertEqual2(kwargs, "{'a': u'0', 'b': u'1', 'c': u'2'}") 294 295 def test_tag_bool_args1(self): 296 """ 297 The current implementation converts strings to bool if it found 298 the bool words. 294 self.assertEqual2(kwargs, "{'a': 0, 'b': 1, 'c': 2}") 295 296 def test_keywords(self): 297 """ 298 Test True, False and None 299 299 """ 300 300 args, kwargs = self._get_args_info( 301 '{% lucidTag unittest_plugin' 302 ' t1="True" f1="False" t2="true" f2="false" %}' 301 '{% lucidTag unittest_plugin a=True b=False c=None %}' 303 302 ) 304 303 self.assertEqual2(args, "()") 305 304 self.assertEqual2(kwargs, 306 "{'f1': False, 'f2': False, 't1': True, 't2': True}" 307 ) 308 309 #__________________________________________________________________________ 310 # Problems with the current implementation. 311 # We can't pass other things than string. 312 """ 313 Importtant: All follow test will failed! 314 See: 315 http://pylucid.net:8080/pylucid/ticket/202 316 http://pylucid.org/phpBB2/viewtopic.php?t=228 317 """ 318 def test_tag_bool_args2(self): 319 """ 320 Faild in the current implementation! 321 """ 322 args, kwargs = self._get_args_info( 323 '{% lucidTag unittest_plugin t1=True f1=False %}' 324 ) 325 self.assertEqual2(args, "()") 326 self.assertEqual2(kwargs, 327 "{'f1': False, 'f2': False}", 328 error_msg="Faild in the current implementation!" 329 ) 330 331 def test_non_string_args(self): 332 """ 333 Faild in the current implementation! 334 """ 335 args, kwargs = self._get_args_info( 336 '{% lucidTag unittest_plugin arg1=1 arg2=2.0 %}' 337 ) 338 self.assertEqual2(args, "()") 339 self.assertEqual2(kwargs, 340 "{'arg1': 1, 'args2': 2.0}", 341 error_msg="Faild in the current implementation!" 342 ) 343 344 345 305 "{'a': True, 'b': False, 'c': None}" 306 ) 307 308 309 class PluginPreferencesTest(PluginAPI_Base): 310 """ 311 Test the preferences API. 312 313 more info about plugin preferences: 314 http://www.pylucid.org/_goto/153/preferences/ 315 """ 316 def test(self): 317 url = self.command % "test_preferences" 318 content = self._get_plugin_content(url, debug=False) 319 self.assertEqual2( 320 content, 321 "{'index': u'Index', 'print_index': False, 'print_last_page': True," 322 " 'index_url': u'/'}" 323 ) 346 324 347 325