diff --git a/.github/workflows/pull-request-tests.yml b/.github/workflows/pull-request-tests.yml new file mode 100644 index 0000000..de44ed3 --- /dev/null +++ b/.github/workflows/pull-request-tests.yml @@ -0,0 +1,35 @@ +name: "Run tests on pr" + +run-name: ${{ github.actor }} has create a pull request 💻 + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install poetry + run: pip3 install poetry + + - name: Install dependencies + run: poetry install + + - name: Test with pytest + run: make test + \ No newline at end of file diff --git a/tests/container/test_pack.py b/tests/container/test_pack.py index 13339bb..ad791f4 100644 --- a/tests/container/test_pack.py +++ b/tests/container/test_pack.py @@ -53,13 +53,16 @@ def test_installation_on_different_systems( ) as mock_requests, patch( "tempfile.NamedTemporaryFile" ), patch( - "tarfile.open" + "tarfile.open", + return_value=MagicMock(), ) as mock_tarfile, patch( "zipfile.ZipFile" ) as mock_zipfile, patch( "os.makedirs" ), patch( "os.unlink" + ), patch( + "os.chmod" ): install_pack()