Skip to content

Commit 751298f

Browse files
committed
Add unit tests
1 parent 1660b50 commit 751298f

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/pipeline.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,46 @@ jobs:
159159
jupyter-book build . --path-output public
160160
mv public/_build/html public_html
161161
touch public_html/.nojekyll
162+
163+
unittest_matrix:
164+
runs-on: ${{ matrix.operating-system }}
165+
strategy:
166+
matrix:
167+
include:
168+
- operating-system: macos-latest
169+
python-version: '3.14'
170+
171+
- operating-system: ubuntu-latest
172+
python-version: '3.14'
173+
174+
- operating-system: windows-latest
175+
python-version: '3.14'
176+
177+
- operating-system: ubuntu-latest
178+
python-version: '3.13'
179+
180+
- operating-system: ubuntu-latest
181+
python-version: '3.12'
182+
183+
- operating-system: ubuntu-latest
184+
python-version: '3.11'
185+
186+
steps:
187+
- uses: actions/checkout@v4
188+
- name: Setup environment
189+
shell: bash -l {0}
190+
run: |
191+
echo -e "channels:\n - conda-forge\n" > .condarc
192+
- name: Setup Mambaforge
193+
uses: conda-incubator/setup-miniconda@v3
194+
with:
195+
python-version: ${{ matrix.python-version }}
196+
miniforge-version: latest
197+
condarc-file: .condarc
198+
environment-file: binder/environment.yml
199+
- name: Test
200+
shell: bash -l {0}
201+
timeout-minutes: 30
202+
run: |
203+
pip install . --no-deps --no-build-isolation
204+
python -m unittest discover tests

tests/test_shared.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import unittest
2+
from python_workflow_definition.shared import get_dict, get_list
3+
4+
5+
class TestShared(unittest.TestCase):
6+
def test_get_dict(self):
7+
self.assertEqual({"a": 1, "b": 2, "c": 3}, get_dict(a=1, b=2, c=3))
8+
9+
def test_get_list(self):
10+
self.assertEqual([1, 2, 3], get_list(a=1, b=2, c=3))

0 commit comments

Comments
 (0)