def test__namespace_from_project_old_settings(): project = Mock(type_info=("Balloon", "Clown", "Service"), settings={}) plugin = JavaLanguagePlugin() plugin._namespace_from_project(project) assert plugin.namespace == ("com", "balloon", "clown", "service") assert plugin.package_name == "com.balloon.clown.service"
def test_generate_executable_entrypoint_not_specified(project): project.executable_entrypoint = None project.generate() plugin = JavaLanguagePlugin() plugin._namespace_from_project(project) assert (project.executable_entrypoint == plugin.package_name + ".HandlerWrapperExecutable")
def test__namespace_from_project_new_settings(): namespace = ("com", "ball", "clown", "service") project = Mock(settings={"namespace": namespace}) plugin = JavaLanguagePlugin() plugin._namespace_from_project(project) assert plugin.namespace == namespace assert plugin.package_name == "com.ball.clown.service"
def test_generate_executable_entrypoint_old_project_version(project): # If the cli version does not contain the new executable_entrypoint # we will not add it del project.executable_entrypoint project.generate() plugin = JavaLanguagePlugin() plugin._namespace_from_project(project) assert not hasattr(project, "executable_entrypoint")
def test_generate_hook_executable_entrypoint_not_specified(hook_project): hook_project.executable_entrypoint = None with patch.object(hook_project, "_load_target_info", return_value=TEST_TARGET_INFO): hook_project.generate() plugin = JavaLanguagePlugin() plugin._namespace_from_project(hook_project) assert ( hook_project.executable_entrypoint == plugin.package_name + ".HookHandlerWrapperExecutable" )