Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #24

Merged
merged 8 commits into from
Jun 11, 2013
Merged

Add tests #24

merged 8 commits into from
Jun 11, 2013

Conversation

treyhunner
Copy link
Collaborator

I think all code should have tests.

The tests shouldn't depend on the Authorize.NET servers so [mock][] should probably be used to mock calls to request.post and other network calls as needed.

I may turn this into a pull request if I decide to start writing some tests.

Goals of this PR:

  • Add basic test suite allowing python setup.py test to work
  • Add a few example tests
  • Add tox file for supported Python/Django versions
  • Add Travis and Coveralls support

@zen4ever
Copy link
Owner

Yes, either mock or httmock (from #22), whatever makes more sense.

@treyhunner
Copy link
Collaborator Author

I converted this to a pull request and added a checklist to the description.

Which Python/Django versions should be tested? The current tox file I've added tests Python 2.6 and 2.7 and Django 1.4, 1.5, and trunk.

@zen4ever
Copy link
Owner

Yes. Supporting those versions seems reasonable to me. We need Python
2.6 since it goes by default on current version of Amazon Linux. And
hopefully supporting two versions of Django would be enough.

@treyhunner
Copy link
Collaborator Author

@zen4ever can you enable the repository on Travis CI? Travis adds a post-receive hook on Github which requires admin access to add.

@zen4ever
Copy link
Owner

@treyhunner should be enabled now

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9f11aa6 on tests into * on master*.

@treyhunner
Copy link
Collaborator Author

I went with httmock because it's simple.

I added a couple example tests including a test for one of the add_profile success cases.

I added Travis and Coveralls badges to the README file. I can remove that commit if you don't like showing those in the README.

I disabled the coveralls comments on pull requests (they happen on every push which can get annoying).

I think this is ready to be merged now. There are very few tests currently, but some tests are better than none.

@zen4ever
Copy link
Owner

Looks good. Feel free to merge it. I will try to add some more tests later.

treyhunner added a commit that referenced this pull request Jun 11, 2013
@treyhunner treyhunner merged commit 60bdc6a into master Jun 11, 2013
@treyhunner treyhunner deleted the tests branch June 11, 2013 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants