dimanche 26 avril 2020

Simulate a Long Network Request for Python Testing

I need to test a device update function. The function opens a socket on a host and sends a block of text.

The update can take up to 120 seconds. It returns a code for success/failure. To allow continued functioning of the program the update is launched in a thread.

I cannot control the response of the device. The simulation needs to be able to hold an open connection for at least 120 seconds.

It does not need to be safe or scalable since it will only be used for an integration test. The simplest solution is preferred. Pure python is best, but a docker is also acceptable.

Aucun commentaire:

Enregistrer un commentaire