From 7d2c5cc075f028278a1d64dbe293d7ce81fc92b2 Mon Sep 17 00:00:00 2001 From: Divya Sanghvi Date: Sat, 17 Jun 2023 23:43:01 -0400 Subject: [PATCH] changes to test file --- .github/workflows/ci_cd_wf.yml | 29 +++++++++++++++++++++++++++++ tests/test_calculator.py | 17 +++++++++++++++++ 2 files changed, 46 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 diff --git a/tests/test_calculator.py b/tests/test_calculator.py index e69de29b..1a7ee7fb 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -0,0 +1,17 @@ +from calculator import add, div, mul, sub + + +def test_add(): + assert add(1, 1) == 0 + + +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