Skip to content

Commit ed4f046

Browse files
Replacing postman tests with prism mock server
Replacing postman tests with prism mock server
1 parent 51d85f3 commit ed4f046

File tree

26 files changed

+1826
-332
lines changed

26 files changed

+1826
-332
lines changed

.github/workflows/build-test-lint.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- name: Set up Python environment
1818
uses: actions/setup-python@v5
19-
with:
19+
with:
2020
python-version: '3.8'
2121
cache: 'pip'
2222

@@ -27,20 +27,37 @@ jobs:
2727
pip install --upgrade pip
2828
pip install black
2929
sudo pip install flake8
30+
sudo pip install pip-audit
3031
pip install -r requirements.txt -r requirements/dev.txt
3132
working-directory: xero-python
32-
33+
3334
- name: Run Flake8
3435
run: flake8 xero_python
3536
working-directory: xero-python
36-
37+
3738
- name: Build package
3839
run: python setup.py sdist
3940
working-directory: xero-python
4041

41-
# - name: Run Test
42-
# run: |
43-
# source venv/bin/activate
44-
# pip install -r requirements/test.txt
45-
# pytest -v
46-
# working-directory: xero-python
42+
- name: Set up Node environment
43+
uses: actions/setup-node@v2
44+
with:
45+
node-version: 20
46+
47+
- name: Install Prism
48+
run: npm install -g @stoplight/prism-cli
49+
50+
- name: Start PRISM Server
51+
run: ./start-prism.sh & sleep 15
52+
working-directory: xero-python/tests/utils
53+
54+
- name: Run Test
55+
run: |
56+
source venv/bin/activate
57+
pytest -v
58+
working-directory: xero-python
59+
60+
- name: Stop PRISM
61+
if: success() || failure()
62+
run: pkill -f prism
63+
working-directory: xero-python

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The xero-python SDK makes it easy for developers to access Xero's APIs in their
1818
- [Helper Methods](#helper-methods)
1919
- [Usage Examples](#usage-examples)
2020
- [SDK conventions](#sdk-conventions)
21+
- [Running Test(s) in Local](#running-tests-in-local)
2122
- [Participating in Xero’s developer community](#participating-in-xeros-developer-community)
2223
- [Contributing](#contributing)
2324

@@ -540,6 +541,18 @@ created_invoice_attachments_by_file_name = accounting_api.create_invoice_attachm
540541
---
541542
## SDK conventions
542543

544+
545+
---
546+
## Running Test(s) in Local
547+
For Running Test cases PRISM Mock Server needs to be started in the local machine.
548+
Steps to Run Test(s)
549+
* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli**
550+
* Verify Installation: **prism --version**
551+
* Navigate to **tests--> utils--> ** folder in the terminal
552+
* Execute the script **./start-prism.sh**
553+
* This will start the PRISM Server in Local
554+
* Run **pytest** to run the Python test cases.
555+
543556
### Querying & Filtering
544557

545558
Describe the support for query options and filtering

0 commit comments

Comments
 (0)