braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
242 stars 115 forks source link

Document how to test would be nice #51

Closed andymckay closed 9 years ago

andymckay commented 9 years ago

How you run the unit tests in this library isn't obvious. I figured out how to test the unit tests:

pip install nose
nosetests tests/unit

Less clear how to run the integration tests:

nosetests test/integration/
[snip]
FAILED (errors=464, failures=2)

Am I meant to be running a server? It's making lots of urllib3 connections:

ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost

Got an issue and possible pull request to send to you, but don't know how to run the tests :)

dewyze commented 9 years ago

Our testing environment is fairly complex and requires some internal automation. We would advise to test as much as you can in your environment, and we’ll harden during a merge.

Closing this for now. Feel free to submit a PR and we'll take a look.

andymckay commented 9 years ago

I'm confused, you've open sourced the code, you've open sourced the functional tests, but running the functional tests requires a non-open sourced infrastructure?

That seems a bit nonsensical to me. Am I missing something?

dewyze commented 9 years ago

@andymckay You're not missing anything, it's true the integration tests serve a dual purpose. For us, they're tests. For external users, they serve primarily as examples.

If you change the configuration in the test_helper.py to point at your sandbox account, you can run some of the tests and if you need to write your own tests you can do it against sandbox.

If you have a change that requires tests that cannot be run against sandbox, feel free to submit those without tests, or what you would expect the test to look like.