[IMP] test_new_api, test_inherit: improve code of tests