def test_cpuprofile_invalid_monkey_patch_module(self): def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'dummy_method', example_method) self.assertEqual(3, decorator_method(1, 2))
def test_logging_by_decorator(self): def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'example_method', example_method) self.assertEqual(3, decorator_method(1, 2))
def test_cpuprofile_invalid_monkey_patch_module(self): def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'dummy_method', example_method) self.assertEqual(3, decorator_method(1, 2))
def test_logging_by_decorator(self): def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'example_method', example_method) self.assertEqual(3, decorator_method(1, 2))
def test_cpuprofile_no_monkey_patch_modules(self): self.flags(monkey_patch_modules=[]) def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'example_method', example_method) self.assertEqual(3, decorator_method(1, 2))
def test_cpuprofile_no_monkey_patch_modules(self): self.flags(monkey_patch_modules=[]) def example_method(arg1, arg2): return arg1 + arg2 decorator_method = profile_cpu.profile_cputime_decorator( 'example_method', example_method) self.assertEqual(3, decorator_method(1, 2))