Finished tests for protocol.py