Skip to content

Commit

Permalink
Update contributing doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ej2 committed Jan 3, 2024
1 parent cae8ed1 commit 6267c77
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 17 deletions.
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
nose = "*"
coverage = "*"
twine = "*"
pytest = "*"
pytest-cov = "*"

[packages]
urllib3 = ">=2.1.0"
Expand Down
50 changes: 43 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
# Contributing

I am accepting pull requests. Sometimes life gets busy and it takes me a little while to get everything merged in. To help speed up the process, please write tests to cover your changes. I will review/merge them as soon as possible.
I am accepting pull requests. Sometimes life gets busy and it takes me a little while to get everything reviewed and merged in. To help speed up the process, please write tests to cover your changes. I will review/merge them as soon as possible.

# Testing

I use [nose](https://nose.readthedocs.io/en/latest/index.html) and [Coverage](https://coverage.readthedocs.io/en/latest/) to run the test suite.
I use [pytest](https://docs.pytest.org/en/7.4.x/contents.html), [Coverage](https://coverage.readthedocs.io/en/latest/), and [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) to run the test suite.

*WARNING*: The Tests connect to the QBO API and create/modify/delete data. DO NOT USE A PRODUCTION ACCOUNT!

## Testing setup:

1. Create/login into your [Intuit Developer account](https://developer.intuit.com).
2. On your Intuit Developer account, create a Sandbox company and an App.
3. Go to the Intuit Developer OAuth 2.0 Playground and fill out the form to get an **access token** and **refresh token**. You will need to copy the following values into your enviroment variables:
3. Go to the Intuit Developer OAuth 2.0 Playground and fill out the form to get a **refresh token**. You will need to copy the following values into your enviroment variables:
```
export CLIENT_ID="<Client ID>"
export CLIENT_SECRET="<Client Secret>"
export COMPANY_ID="<Realm ID>"
export ACCESS_TOKEN="<Access token>"
export COMPANY_ID="<Realm ID>"
export REFRESH_TOKEN="<Refresh token>"
```

*Note*: You will need to update the access token when it expires.
*Note*: You will need to update the refresh token when it expires.

5. Install *nose* and *coverage*. Using Pip:
`pip install nose coverage`
5. Install *pytest*, *coverage*, and *pytest-cov*. Using Pip (or whatever):
`pip install pytest coverage pytest-cov`

6. Run `nosetests . --with-coverage --cover-package=quickbooks`
6. Run all tests: ```pytest --cov```
Run only unit tests: ```pytest tests/unit --cov```
Run only integration tests: ```pytest tests/intergration --cov```



## Creating new tests
Normal Unit tests that do not connect to the QBO API should be located under `test/unit` Test that connect to QBO API should go under `tests/integration`. Inheriting from `QuickbooksTestCase` will automatically setup `self.qb_client` to use when connecting to QBO.
Expand Down

0 comments on commit 6267c77

Please sign in to comment.