コード例 #1
0
 def test_require_at_least_one_but_none_provided(self):
     """Test that MissingParameterError is raised if no argument is supplied
     when at least one is required.
     """
     from plone.api.exc import MissingParameterError
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertRaises(MissingParameterError, _func)
コード例 #2
0
 def test_require_at_least_one_but_none_provided(self):
     """Test that MissingParameterError is raised if no argument is supplied
     when at least one is required.
     """
     from plone.api.exc import MissingParameterError
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertRaises(MissingParameterError, _func)
コード例 #3
0
ファイル: test_validation.py プロジェクト: CGTIC/Plone_SP
 def test_require_at_least_one_and_several_provided(self):
     """Test for passing several arguments when at least one is required."""
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertEqual(_func('ahoy', 'there'), 'foo')
     self.assertEqual(_func(arg1='ahoy', arg2='there'), 'foo')
     self.assertEqual(_func('ahoy', arg2='there', arg3='matey'), 'foo')
コード例 #4
0
ファイル: test_validation.py プロジェクト: CGTIC/Plone_SP
 def test_require_at_least_one_and_one_provided(self):
     """Test for passing one argument when at least one is required."""
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertEqual(_func('ahoy'), 'foo')
     self.assertEqual(_func(arg2='ahoy'), 'foo')
コード例 #5
0
ファイル: test_validation.py プロジェクト: kkdhanesh/NBADEMO
 def test_require_at_least_one_and_several_provided(self):
     """Test for passing several arguments when at least one is required."""
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertEquals(_func('ahoy', 'there'), 'foo')
     self.assertEquals(_func(arg1='ahoy', arg2='there'), 'foo')
     self.assertEquals(_func('ahoy', arg2='there', arg3='matey'), 'foo')
コード例 #6
0
ファイル: test_validation.py プロジェクト: kkdhanesh/NBADEMO
 def test_require_at_least_one_and_one_provided(self):
     """Test for passing one argument when at least one is required."""
     _func = at_least_one_of('arg1', 'arg2')(undecorated_func)
     self.assertEquals(_func('ahoy'), 'foo')
     self.assertEquals(_func(arg2='ahoy'), 'foo')