diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d373aa18..bd62e7dc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -4,8 +4,6 @@ name: Unit and Functional Pytest on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ] @@ -23,6 +21,13 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" + - name: Install snapd + run: | + sudo apt update + sudo apt install snapd + - name: Install MiniZinc + run: | + sudo snap install minizinc --classic - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/tests/functional/test_unavailability_get.py b/tests/functional/test_unavailability_get.py index 5682f044..1765af4c 100644 --- a/tests/functional/test_unavailability_get.py +++ b/tests/functional/test_unavailability_get.py @@ -13,6 +13,7 @@ def test_get_volunteer_unavailability_success(test_client, create_user): assert response.status_code == 200 + def test_get_volunteer_unavailability_no_records(test_client, create_user): user_id = create_user # Assuming this user has no unavailability records test_client.post(f"/v2/volunteers/{user_id}/unavailability") @@ -21,6 +22,7 @@ def test_get_volunteer_unavailability_no_records(test_client, create_user): assert response.json == {"message": "No unavailability record found."} # Expected response body for no records + def test_get_volunteer_unavailability_invalid_user(test_client): user_id = -1 test_client.environ_base.pop('HTTP_AUTHORIZATION', None) @@ -37,4 +39,4 @@ def test_get_volunteer_unavailability_invalid_user(test_client): assert response.status_code == 401 # Assuming the system treats requests for non-existent users as bad requests # or not found # assert response.json == {"message": "User not found"} # Assuming this is the response for an invalid user ID - # assert response.json == {'message': "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."} \ No newline at end of file + # assert response.json == {'message': "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."}