-
Notifications
You must be signed in to change notification settings - Fork 1
virtualenv_logic #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
main.py
Outdated
print(result) | ||
|
||
x = StringValue(value="hello, world") | ||
adder = TestMessageAdder(appender="!", port=8788) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут раньше еще по дефолту же докер был, надо чтоб и он тестился, чтоб не сломалось например изменениями
process_chmod = subprocess.run(f'chmod +x {self.project_output_path}create_venv.sh', shell=True) | ||
process_run = subprocess.run(f'{self.project_output_path}create_venv.sh', shell=True) | ||
|
||
def create_files_for_tests(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот тест он для чего? он точно внутри должен быть, а не где-то в папке tests в корне проекта?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот тест генерится уже для конечного пользователя. Создается он во вновь созданной директории проекта, которая может быть (и чаще всего) отлично от исходной диреткории нашего шаблона. Тест првоеряет корректность созданного и активированного виртуального окружения и запуск функционала из файла main.py
) | ||
|
||
@staticmethod | ||
def render_venv_python(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот это хорошая мысль, и нейминг, возможно мы ее как-то расширим для разных уровней вложенности энвов друг в друга
output.write("\n".join(requirements)) | ||
|
||
|
||
class VirtualEnvExecutor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пока так отлично, но на будущее куда-то себе пометить мысль, что это некий микс выходит энва и экзекьютора, то есть может сделать именно енвом эту логику, а экзекьюторы более абстрактными без исполнения и только на тестах выяснять что все ок исполняется
import argparse | ||
|
||
|
||
def sum_factorial(number: int) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это как некий мок?
Может просто в лог выводить "Found no implementation! Fix it, please!"
from piper_new_out.main import sum_factorial | ||
|
||
|
||
def test_base_func_from_main(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это просто не в темплейт надо, а отнаследоваться от VenvExecutor и добавить в call факториала подсчет, тогда отличный тест как раз выйдет, что все ок на просто примере оборачивается)
add params to py and sh scripts, refactor structure and methods, add …