示例#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
示例#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 external_fn_a()')
         eq_(master_mock.mock_calls, [])
         raise
示例#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()
     ])
示例#5
0
def test_no_patch():
    try:
        internal_module.my_fn()
    except RuntimeError as e:
        eq_(str(e), 'called external_fn_a()')
        raise
示例#6
0
def test_no_patch():
    try:
        internal_module.my_fn()
    except RuntimeError as e:
        eq_(str(e), 'called external_fn_a()')
        raise