pythonpython-2.7pyzmqrpyc

What would be the pythonic way to simulate communication with an external equipment? RPyC?


Think of a situation where a Python script sends commands to an external device,let's say, via serial port. The script resides on some Linux machine and the equipment reacts to some commands. The idea is to simulate all this chain on my machine by "sending" commands to a file which contains the dump that would be generated by the equipment, otherwise. It is first time when I'm trying such thing and it will be good to hear from someone who had experience with such situation. I red on the web and people are talking about few direction:

It might be more but not aware of. Any suggestions?


Solution

  • Assuming you actually test in real-world conditions (e.g. with the real device) but need to perform some tests on some particular conditions that are difficult to consistently reproduce in practice, you can simply mock the part of that communicates with the device to simulate those "edge" cases.