Ejemplo n.º 1
0
 def inner(master_mock):
     try:
         internal_module.my_fn()
     except RuntimeError as e:
         eq_(str(e), 'called external_fn_a()')
         eq_(master_mock.mock_calls, [])
         raise
Ejemplo n.º 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()])
Ejemplo n.º 3
0
 def inner(master_mock):
     try:
         internal_module.my_fn()
     except RuntimeError as e:
         eq_(str(e), 'called external_fn_a()')
         eq_(master_mock.mock_calls, [])
         raise
Ejemplo n.º 4
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()
     ])
Ejemplo n.º 5
0
def test_no_patch():
    try:
        internal_module.my_fn()
    except RuntimeError as e:
        eq_(str(e), 'called external_fn_a()')
        raise
Ejemplo n.º 6
0
def test_no_patch():
    try:
        internal_module.my_fn()
    except RuntimeError as e:
        eq_(str(e), 'called external_fn_a()')
        raise