From d0ae9f329685a19136cfd9a890b305db3bc384b9 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 30 Jun 2022 12:11:59 +0200 Subject: Improve tests --- tests/api_send0_eth0_1s1r/receiver.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/api_send0_eth0_1s1r/receiver.py (limited to 'tests/api_send0_eth0_1s1r/receiver.py') diff --git a/tests/api_send0_eth0_1s1r/receiver.py b/tests/api_send0_eth0_1s1r/receiver.py new file mode 100644 index 0000000..3f7a7db --- /dev/null +++ b/tests/api_send0_eth0_1s1r/receiver.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +def receive(api): + ##### Simple receive + code, data=api.receive("eth0") + msg="Received: "+data if code == 0 else "Receive failed code="+str(code) + api.log(msg) + +def execute(api): + receive(api) + # Simulated time t=0s here + receive(api) + # Simulated time t=0s here + receive(api) + # Simulated time t=1s here + receive(api) + # Simulated time t=3s here + code, data=api.receivet("eth0",0) + msg="Received: "+data if code == 0 else "Receive failed code="+str(code) + api.log(msg) + # Simulated time t=3s here + + -- cgit v1.2.3