Assignment 3

Your computer runs (localhost) several HTTP servers on various ports. The server serves the get following requests (you can try it in your browser): For testing purposes consider the following implementation (the implementation is greatly simplified, no checks for errors, etc.) of the servers together with a script that runs the servers nodes.zip. The nodes basicaly create a directed graph, thus I will use graph terminology.

Implement the following coroutines: Your implementation should use (at least to a degree) cooperative multitasking. For each coroutine, implement one unit test (you need not to cover everything). The unittest should not include networking. Also write one system test where each function is called. The system test should include running the servers and all the networking. Note that the code that creates and runs the servers takes some condition variables. You can use them to synchorize your system test. Finally, write a test that checks that your coroutines execute the requests in parallel instead of synchronously. One of the ways to do this is to fake the networking part of your program so that handling of each request includes some sleep time and then check, if the resulting time is aproximately as expected.

You should write your code in Python. Send your solution to lukotka.pts@gmail.com. The deadline is 6.5.2020 23:59:59