All Questions
5 questions
1
vote
1
answer
501
views
Python Unit Tests Mocking Imports - Removing Dependencies for CI/CD
I have a project written in python that I would like to create unit tests on.
This project has a dependency on a database project which is a sort of abstraction layer to data connections.
The issue ...
0
votes
2
answers
475
views
What if integration testing makes more sense than unit testing for a certain method?
I don't want to spam you with a ton of code, but please have a quick look at this boiler-plate method:
In this scenario let's say I have a ProcessingText.py file (class) that I finished its unit ...
1
vote
1
answer
801
views
How deep should I mock dependencies in unit tests
Consider the following function:
def get_api_status(api_client):
response = api_client.get('/status/')
return response.content
and the test for it:
def test_get_api_status():
...
0
votes
1
answer
330
views
How to write a good mock for testing
I code in Python and I'm starting to use the Mock library.
Although I've read through all of the documentation, something that I'm finding hard to understand is 'What makes a good mock'.
For example,...
1
vote
2
answers
2k
views
How to populate a private container for unit test?
I have a class that defines a private (well, __container to be exact since it is python) container. I am using the information within said container as part of the logic of what the class does and ...