We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

But how do you know your mock is valid? Verified fakes of web services

Formale Metadaten

Titel
But how do you know your mock is valid? Verified fakes of web services
Serientitel
Anzahl der Teile
160
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
But how do you know your mock is valid? Verified fakes of web services [EuroPython 2017 - Talk - 2017-07-10 - Arengo] [Rimini, Italy] If your code calls a third party service then you may want to test that your code works but you don't want to call the service in your tests. It may be expensive, slow or impossible to call that service. For example, if you are making a Slack bot, you want to create tests which don't make calls across the network to Slack. One approach is to create a mock of that service. Our tests can now run quickly, cheaply and reliably. But if we copy the service incorrectly, or if the service changes, our tests will pass while our code does not work. Verified fakes solve this problem. You can write tests which confirm that your mock is an accurate representation of the service being mocked. Those tests can be a small subset of your test suite and they can be run periodically, to verify the validity of the many tests which use the mock. This talk will follow the example of VWS-Python, a verified fake for a proprietary web service. It will discuss the practicalities of creating such a fake and it will focus on the trade-offs, tooling and approaches involved. By the end of this talk the audience will understand how to tie together pytest, Travis CI, requests and Responses to create a verified fake. The talk is aimed at people who have an interest in writing correct software. It is assumed that the audience is familiar with basic testing techniques