From bca0d1628961788a733b858f6bac1f97b3c0f006 Mon Sep 17 00:00:00 2001 From: Dindihub <100135497+Dindihub@users.noreply.github.com> Date: Sun, 12 Nov 2023 07:46:58 +0000 Subject: [PATCH 1/3] add falsy test --- .github/workflows/ci_cd_wf.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci_cd_wf.yml diff --git a/.github/workflows/ci_cd_wf.yml b/.github/workflows/ci_cd_wf.yml new file mode 100644 index 00000000..8ca03d4c --- /dev/null +++ b/.github/workflows/ci_cd_wf.yml @@ -0,0 +1,29 @@ +name: test + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Check out repo code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + + - name: Install Dependencies + run: | + python -m pip install -r requirements.txt + - name: Run tests + run: | + python -m pytest -v tests \ No newline at end of file From 80b726379eac85c36001fb15681e034ce6d63949 Mon Sep 17 00:00:00 2001 From: Dindihub <100135497+Dindihub@users.noreply.github.com> Date: Sun, 12 Nov 2023 07:58:05 +0000 Subject: [PATCH 2/3] Correct falsy test --- tests/test_calculator.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_calculator.py b/tests/test_calculator.py index e69de29b..97f7bd56 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -0,0 +1,17 @@ +from src.calculator import add, div, mul, sub + + +def test_add(): + assert add(1, 1) == 2 + + +def test_sub(): + assert sub(1, 1) == 0 + + +def test_mul(): + assert mul(1, 1) == 1 + + +def test_div(): + assert div(2, 1) == 2 \ No newline at end of file From 8bb5b5b1ddbe49bc942edc04441930501a58edf7 Mon Sep 17 00:00:00 2001 From: Dindihub <100135497+Dindihub@users.noreply.github.com> Date: Tue, 28 Nov 2023 07:38:47 +0000 Subject: [PATCH 3/3] change parameters in multiplication test --- tests/test_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_calculator.py b/tests/test_calculator.py index 97f7bd56..ec584a93 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -10,7 +10,7 @@ def test_sub(): def test_mul(): - assert mul(1, 1) == 1 + assert mul(2, 1) == 2 def test_div():