diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index fdef6146..b2cdbcf3 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -27,9 +27,14 @@ jobs: pip install --upgrade pip pip install black sudo pip install flake8 + sudo pip install pip-audit pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python + - name: Check vulnerable packages + run: pip-audit -r requirements.txt -r requirements/dev.txt + working-directory: xero-python + - name: Run Flake8 run: flake8 xero_python working-directory: xero-python diff --git a/README.md b/README.md index bc6bbf51..2bfd07da 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The xero-python SDK makes it easy for developers to access Xero's APIs in their - [Helper Methods](#helper-methods) - [Usage Examples](#usage-examples) - [SDK conventions](#sdk-conventions) +- [Running Test(s) in Local](#running-tests-in-local) - [Participating in Xero’s developer community](#participating-in-xeros-developer-community) - [Contributing](#contributing) @@ -540,6 +541,18 @@ created_invoice_attachments_by_file_name = accounting_api.create_invoice_attachm --- ## SDK conventions + +--- +## Running Test(s) in Local +For Running Test cases PRISM Mock Server needs to be started in the local machine. +Steps to Run Test(s) +* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli** +* Verify Installation: **prism --version** +* Navigate to **tests--> utils--> ** folder in the terminal +* Execute the script **./start-prism.sh** +* This will start the PRISM Server in Local +* Run **pytest** to run the dotnet test cases. + ### Querying & Filtering Describe the support for query options and filtering diff --git a/requirements.txt b/requirements.txt index 11231fa7..7be89c5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ # make sure content of this file can be parsed by setup.load_requirements python-dateutil>=2.7 -urllib3 +urllib3>=2.2.3 certifi +setuptools>=75.1.0 diff --git a/tests/utils/start-prism.sh b/tests/utils/start-prism.sh new file mode 100755 index 00000000..92b55f1d --- /dev/null +++ b/tests/utils/start-prism.sh @@ -0,0 +1,9 @@ +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_bankfeeds.yaml --host 127.0.0.1 --port 4013 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-finance.yaml --host 127.0.0.1 --port 4014 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-uk.yaml --host 127.0.0.1 --port 4015 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-nz.yaml --host 127.0.0.1 --port 4016 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-au.yaml --host 127.0.0.1 --port 4017 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-projects.yaml --host 127.0.0.1 --port 4018