diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..fa530a9 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,22 @@ +on: [push, pull_request] +name: Pytest +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + python-version: ['3.7', '3.8' ,'3.9', '3.10', '3.11'] + fail-fast: false + name: Python ${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.frontend }} build + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install requirements + run: | + pip install pytest + - name: Run pytest + run: python -m pytest + diff --git a/tests/config.py b/tests/config.py new file mode 100644 index 0000000..df41b35 --- /dev/null +++ b/tests/config.py @@ -0,0 +1 @@ +# This is just an empty file diff --git a/tests/simple_salesforce.py b/tests/simple_salesforce.py new file mode 100644 index 0000000..d37e5be --- /dev/null +++ b/tests/simple_salesforce.py @@ -0,0 +1,4 @@ +# This is just a file to mock the import +from unittest.mock import Mock + +Salesforce = Mock() diff --git a/tests/test_transcodeEngine.py b/tests/test_transcodeEngine.py new file mode 100644 index 0000000..8b24557 --- /dev/null +++ b/tests/test_transcodeEngine.py @@ -0,0 +1,15 @@ +import pathlib +import pytest + + +@pytest.mark.parametrize( + 'file_path,expected_barcode', + [ + (pathlib.Path('12345677890.mp4'), '5677890'), + (pathlib.Path('12346677890.mov'), '6677890'), + ] +) +def test_getBarcode(file_path, expected_barcode): + import transcodeEngine + assert transcodeEngine.getBarcode(str(file_path)) == expected_barcode +