def test_choice(self):
     rf = ResourceField('f', {
         'example': 'mpm',
         'choices': [
             'prefork',
             'worker'
         ]
     })
     rf.check_choice('prefork')
 def test_choice_callable(self):
     callable = mock.Mock(return_value=[
         'prefork',
         'worker'
     ])
     rf = ResourceField('f', {
         'example': 'mpm',
         'choices': callable
     })
     assert not callable.reset_mock()
     rf.check_choice('prefork')
     callable.assert_called_once_with()
Пример #3
0
 def test_choice_callable(self):
     callable = mock.Mock(return_value=['prefork', 'worker'])
     rf = ResourceField('f', {'example': 'mpm', 'choices': callable})
     assert not callable.reset_mock()
     rf.check_choice('prefork')
     callable.assert_called_once_with()
Пример #4
0
 def test_choice(self):
     rf = ResourceField('f', {
         'example': 'mpm',
         'choices': ['prefork', 'worker']
     })
     rf.check_choice('prefork')