X
X
Xveeder2022-01-10 20:20:18
Python
Xveeder, 2022-01-10 20:20:18

How to test integration libraries?

Good afternoon, ladies and gentlemen.

The crux of the matter is as follows. I wrote a small wrapper over the API of one service. I wrote tests for the auxiliary data preparation functionality, but the question arises of testing methods that, based on this data, interact with the service itself.

The first thing that comes to mind is testing through real API requests. But there is a feeling that it is too expensive in terms of resources. In addition, some methods require special conditions for a third-party service to work. For example, to test a method to create a resource, it is necessary that it has not yet been created on the service.

Alternatively, I see mocks or stubs, but then testing becomes not too close to reality. What reasonable practices do you see in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2022-01-10
@fox_12

Use mockups as an option.
Or wiremock.org which will collect the necessary requests in proxy mode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question