Add tests for relay.py