Skip to content

nashtech-vietvuhoang1/hello-python

Repository files navigation

hello-python

Learn Python

Install

poetry install

Run test

Run all test

pytest

Run Test for Cases

pytest tests/greetings/case

Run Test for OCP

pytest tests/greetings/ocp

Add more language to OCP tests/greetings/ocp/greeting_ocp_test.py

  def test_support_new_lang(self):
    register("vi", lambda name: f"Xin Chao, {name}!")
    assert greet("vi", "Viet") == f"Xin Chao, Viet!"

Generate Coverage

pytest --cov=greetings --cov-report html

Build Docker Image

docker buildx build -t hello-python:0.0.1 .