Comments (5)
Great that you are open changing the tests.
Regarding testing against the live API: Yes, but I would suggest to create a different set of tests (integration tests) for this purpose.
The unit tests on the other hand would only test the integrity of the code itself.
from hubspot3.
Thanks for bringing this issue up!
Yeah it'd probably be best to mock those all out - I had started on rebuilding the test suite and quickly ran into all sorts of problems trying to get how I wanted to test things working (including a nasty workaround that you've found in a couple different places for loading a record on boot to use for testing
hubspot3/hubspot3/test/test_contacts.py
Lines 12 to 14 in 6791c78
Good point on the test_get_all
tests as well - there's a lot of the testing that I hadn't completely thought through when I started writing the tests!
I'd agree with you that mocking the calls would probably be best - I'm open to any methods of doing so that you guys are comfortable with!
from hubspot3.
I've also created a topic on the HubSpot developer forum about this, and asked if we could potentially have a different key specific for testing - I do feel that mocking it is fine, but not entirely optimal. If we could be hitting the real API during tests, that'd allow us to test for any changes that they've made as well.
from hubspot3.
Good point - that makes a lot of sense!
from hubspot3.
As of the latest commit/release 3.2.17
, I've included my test account key in the tests, so we should be able to use that key for integration tests (so at least we can get the old tests back up and running on Travis!). I've also switched the CI to use tox across the three supported versions we've specified.
I'm still on board with also building out a bunch of unit tests for the library that use your mocking methods - I'll just start slowly writing out some new tests when I get some more time!
from hubspot3.
Related Issues (20)
- Async implementation is in the roadmap? HOT 1
- Updating a Hubspot Company is not doing anything
- Get data from HubspotConflict
- Review API and use version 3 instead of 1?
- Unable to pass params to contacts.get_all() HOT 1
- Help needed - Is there any way to load all the events using Web Analytics API
- Error on calling client.usage_limits
- Feature request: support for /email/public/v1/events endpoint
- ACCESS TOKEN example HOT 1
- Disabling auto-retry spams out warnings HOT 2
- Emit metrics about API calls
- Trouble using the command line "AttributeError: 'int' object has no attribute 'value'" HOT 16
- Not found response on create or update pipeline HOT 2
- How would you paginate the contacts? HOT 2
- Question: Transactional Email API HOT 1
- Result window too large when querying recently modified companies HOT 3
- How to paginate contacts? HOT 1
- Engagement API, function get_associated contains two print statements HOT 2
- No verbose output to log in case of retries
- get_all() fails HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubspot3.