Skip to content

Commit 3328aea

Browse files
committed
fix tests and update Github actions
1 parent ea1eaef commit 3328aea

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

.github/workflows/run-tests.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,16 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', '3.11']
16+
python-version: ['3.9', '3.12', '3.13']
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
- name: Set up Python
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
24+
cache: 'pip' # caching pip dependencies
2425
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install flake8 pytest
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
- name: Test Tasks
30-
run: python tests/unit/testTask.py
31-
- name: Test Jobs
32-
run: python tests/unit/testJob.py
33-
- name: Test Webhooks
34-
run: python tests/unit/testWebhookSignature.py
26+
run: pip install -r requirements.txt
27+
- name: Run tests
28+
run: python -m unittest -v

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"python.testing.unittestArgs": [
3+
"-v",
4+
"-s",
5+
"./tests",
6+
"-p",
7+
"test*.py",
8+
"-t",
9+
"."
10+
],
11+
"python.testing.pytestEnabled": false,
12+
"python.testing.unittestEnabled": true
13+
}

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,14 @@ url = cloudconvert.SignedUrl.sign(base, signing_secret, job, cache_key); # retu
132132
## Unit Tests
133133

134134
```
135-
# Run Task tests
136-
$ python tests/unit/testTask.py
137-
138-
# Run Job tests
139-
$ python tests/unit/testJob.py
140-
141-
# Run Webhook tests
142-
$ python tests/unit/testWebhookSignature.py
135+
python -m unittest discover -s tests/unit
143136
144137
```
145138

146139
## Integration Tests
147140

148141
```
149-
# Run Integration test for task
150-
$ python tests/integration/testTasks.py
151-
152-
# Run Integration test for Job
153-
$ python tests/integration/testJobs.py
142+
python -m unittest discover -s tests/integration
154143
155144
```
156145

tests/integration/testJobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def testUploadAndDownloadFiles(self):
7878
fileName = exported_task.get("result").get("files")[0].get("filename")
7979

8080
# now download the exported file
81-
cloudconvert.download(url=exported_url, filename="out/" + fileName)
81+
cloudconvert.download(url=exported_url, filename=os.path.join(os.path.dirname(os.path.realpath(__file__)), "out/" + fileName))
8282

8383
def tearDown(self):
8484
"""

0 commit comments

Comments
 (0)