Пример #1
0
 def inner(master_mock):
     internal_module.my_fn()
     eq_(master_mock.mock_calls, [
         call.external_fn_a(),
         call.external_fn_b(),
         call.internal_fn_a(),
         call.internal_fn_b()])
Пример #2
0
 def inner(master_mock):
     internal_module.my_fn()
     eq_(master_mock.mock_calls, [
         call.external_fn_a(),
         call.external_fn_b(),
         call.internal_fn_a(),
         call.internal_fn_b()
     ])
Пример #3
0
 def inner(master_mock):
     try:
         internal_module.my_fn()
     except RuntimeError as e:
         eq_(str(e), 'called internal_fn_a()')
         eq_(master_mock.mock_calls,
             [call.external_fn_a(),
              call.external_fn_b()])
         raise
Пример #4
0
 def inner(master_mock):
     try:
         internal_module.my_fn()
     except RuntimeError as e:
         eq_(str(e), 'called internal_fn_a()')
         eq_(master_mock.mock_calls, [
             call.external_fn_a(),
             call.external_fn_b()])
         raise