Support unavailable
Please try again later

Mocket: a Socket Mock Framework

It is inconsistent in an agile environment to dismiss the usage of testing tools. TDD has changed developers’ day by day job. Also Python has some useful tools, like nose, py.test and coverage to support the TDD method.

Today web services are complex with many entities bound together and we only have two ways to test the whole system:

  • using external entities in the test environment
  • creating mocks

Usually developers surrender to the 1st solution; it could be very dangerous if not impossible due to the impact on the third part production environment.

Creating a mock from scratch could prove to be very expensive and repetitive as it needs to be sync’d with the original service. Initially our need was to find an HTTP mock and then a Redis one. After the research we realized that what we found is too focused to a specific solution and sometimes incomplete. We also realized that what we needed were not mocks but a Socket Mock Framework. Following the HTTPretty principles we started redesigning its core to plug the Redis mock and we called it Mocket (pronounced like the french word ‘moquette’). Mocket can drive the socket operations at our will. In the talk we’ll show how to test some code and we’ll try to write the memcached plugin.

in on Thursday 4 July at 14:30 See schedule

Do you have some questions on this talk? Leave a comment to the speaker!

New comment

60 minutes (inc Q&A)

Tagged as

testing socket tdd
Our Sponsors
Python Experts
SSL Matrix
Wanna sponsor?