comparison MoinMoin/_tests/test_wikiutil.py @ 2547:c2ef5800253f

consolidate extra keyword args handling, no more **kw/_non_ascii_kw but rather just _kwargs
author Johannes Berg <johannes AT sipsolutions DOT net>
date Mon, 23 Jul 2007 19:38:16 +0200
parents 56dbfbde79fe
children 5db66a25f0ba
comparison
equal deleted inserted replaced
2546:56dbfbde79fe 2547:c2ef5800253f
515 assert choice == u'a' 515 assert choice == u'a'
516 516
517 def _test_trailing(self, a, _trailing_args=[]): 517 def _test_trailing(self, a, _trailing_args=[]):
518 assert _trailing_args == [u'a'] 518 assert _trailing_args == [u'a']
519 519
520 def _test_arbitrary_kw(self, expect, _non_ascii_kwargs={}, **kw): 520 def _test_arbitrary_kw(self, expect, _kwargs={}):
521 assert _non_ascii_kwargs == expect 521 assert _kwargs == expect
522 assert kw == {'test': u'x'}
523 522
524 def testInvoke(self): 523 def testInvoke(self):
525 ief = wikiutil.invoke_extension_function 524 ief = wikiutil.invoke_extension_function
526 ief(self.request, self._test_invoke_bool, u'False') 525 ief(self.request, self._test_invoke_bool, u'False')
527 ief(self.request, self._test_invoke_bool, u'b=False') 526 ief(self.request, self._test_invoke_bool, u'b=False')
566 self._test_invoke_float_None, u'""') 565 self._test_invoke_float_None, u'""')
567 py.test.raises(ValueError, ief, self.request, 566 py.test.raises(ValueError, ief, self.request,
568 self._test_invoke_float_None, u'i=""') 567 self._test_invoke_float_None, u'i=""')
569 ief(self.request, self._test_trailing, u'a=7, a') 568 ief(self.request, self._test_trailing, u'a=7, a')
570 ief(self.request, self._test_arbitrary_kw, u'test=x, \xc3=test', 569 ief(self.request, self._test_arbitrary_kw, u'test=x, \xc3=test',
571 [{u'\xc3': 'test'}]) 570 [{u'\xc3': 'test', 'test': u'x'}])
572 ief(self.request, self._test_arbitrary_kw, u'test=x, "\xc3"=test', 571 ief(self.request, self._test_arbitrary_kw, u'test=x, "\xc3"=test',
573 [{u'\xc3': 'test'}]) 572 [{u'\xc3': 'test', 'test': u'x'}])
574 ief(self.request, self._test_arbitrary_kw, u'test=x, "7 \xc3"=test', 573 ief(self.request, self._test_arbitrary_kw, u'test=x, "7 \xc3"=test',
575 [{u'7 \xc3': 'test'}]) 574 [{u'7 \xc3': 'test', 'test': u'x'}])
576 ief(self.request, self._test_arbitrary_kw, u'test=x, 7 \xc3=test', 575 ief(self.request, self._test_arbitrary_kw, u'test=x, 7 \xc3=test',
577 [{u'7 \xc3': 'test'}]) 576 [{u'7 \xc3': 'test', 'test': u'x'}])
578 ief(self.request, self._test_arbitrary_kw, u'7 \xc3=test, test= x ', 577 ief(self.request, self._test_arbitrary_kw, u'7 \xc3=test, test= x ',
579 [{u'7 \xc3': 'test'}]) 578 [{u'7 \xc3': 'test', 'test': u'x'}])
580 579
581 coverage_modules = ['MoinMoin.wikiutil'] 580 coverage_modules = ['MoinMoin.wikiutil']