def libcore_stub_gen_fake_base_test(): name = 'vamostest.library' fd = read_lib_fd(name) ctx = _create_ctx() # create stub gen = LibStubGen() stub = gen.gen_fake_stub(name, fd, ctx) _check_stub(stub) # call func stub.PrintHello() stub.Dummy() stub.Swap()
def libcore_stub_gen_fake_profile_test(): name = 'vamostest.library' fd = read_lib_fd(name) ctx = _create_ctx() profile = LibProfileData(fd) # create stub gen = LibStubGen() stub = gen.gen_fake_stub(name, fd, ctx, profile) _check_stub(stub) # call func stub.PrintHello() stub.Dummy() stub.Swap() _check_profile(fd, profile)
def libcore_stub_gen_fake_log_test(caplog): caplog.set_level(logging.INFO) name = 'vamostest.library' fd = read_lib_fd(name) ctx = _create_ctx() log_missing = logging.getLogger('missing') log_valid = logging.getLogger('valid') # create stub gen = LibStubGen(log_missing=log_missing, log_valid=log_valid) stub = gen.gen_fake_stub(name, fd, ctx) _check_stub(stub) # call func stub.PrintHello() stub.Dummy() stub.Swap() _check_log_fake(caplog)
def libcore_stub_gen_fake_log_profile_test(caplog): caplog.set_level(logging.INFO) name = "vamostest.library" fd = read_lib_fd(name) ctx = _create_ctx() log_missing = logging.getLogger("missing") log_valid = logging.getLogger("valid") profile = LibProfileData(fd) # create stub gen = LibStubGen(log_missing=log_missing, log_valid=log_valid) stub = gen.gen_fake_stub(name, fd, ctx, profile) _check_stub(stub) # call func stub.PrintHello() stub.Dummy() stub.Swap() _check_log_fake(caplog) _check_profile(fd, profile)