Add Utils class for entrypoint retrieval and refactor internal classes#1912
Open
vinioliveira-totvs wants to merge 3 commits intorelease/v2.7.0rc1from
Open
Add Utils class for entrypoint retrieval and refactor internal classes#1912vinioliveira-totvs wants to merge 3 commits intorelease/v2.7.0rc1from
vinioliveira-totvs wants to merge 3 commits intorelease/v2.7.0rc1from
Conversation
Release/v2.7.0rc1
… stack; refactor WebappInternal and PouiInternal classes to utilize new utility methods.
…cumentation and add comprehensive unit tests for various scenarios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descrição
Objetivo
Consolidar a lógica duplicada de detecção de função de entrada (entrypoint) que existia em
WebappInternalePouiInternalem uma classe utilitária centralizada.O que é o arquivo
utils.py?O novo arquivo
tir/technologies/core/utils.pycria uma classeUtilsque centraliza métodos utilitários compartilhados entre as tecnologias TIR.Ideia principal: Evitar duplicação de código ao extrair funcionalidades comuns em um local único, reutilizável e bem testado.
Alterações
1. Nova classe
Utils(tir/technologies/core/utils.py)get_main_entrypoint_from_stack(): Identifica qual função de teste/entrada iniciou uma cadeia de chamadas2. Refatoração de
WebappInternalget_function_from_stack()self.utils = Utils()emBaselog_error()para usarself.utils.get_main_entrypoint_from_stack()[test_name] - message3. Refatoração de
PouiInternalget_function_from_stack()Base4. Testes Unitários (
tests/test_utils.py)Benefícios
Antes: Métodos duplicados em 2 classes
Depois: Lógica centralizada, reutilizável e testada