import os

from celery import Celery

app = Celery('dummy_tasks', broker=os.environ['TEST_HADES_BROKER_URI'],
             backend=os.environ['TEST_HADES_RESULT_BACKEND_URI'])

@app.task
def get_port_auth_attempts(nasipaddress, nasportid):
    return ["Success!", "No success! :-(",
            "Gotten: {}/{}".format(nasipaddress, nasportid)]

@@ -2,16 +2,69 @@
 mport os
+%0Afrom datetime import datetime%0Afrom time import sleep
 %0A%0Afrom c
@@ -223,16 +223,17 @@
 URI'%5D)%0A%0A
+%0A
 @app.tas
@@ -288,111 +288,804 @@
 rtid
-):%0A    return %5B%22Success!%22, %22No success! :-(%22,%0A            %22Gotten: %7B%7D/%7B%7D%22.format(nasipaddr
+, limit=100):%0A    if nasportid == 'magic_sleep':%0A        # sleep for 10 seconds, which is longer than the default%0A        sleep(10)%0A        return %5B%5D%0A%0A    if nasipaddress != '141.30.223.206' or nasportid != 'C6':%0A        return %5B%5D%0A    return %5B%0A        # (packettype, replymessage, username, auth_date, egress_vlan)%0A        # TODO: What VLAN should there be on Auth-Reject?  In any%0A        # case, it will be unused.%0A        (%22Auth-Reject%22, %22%22, %2200:de:ad:be:ef:00%22, datetime(2017, 4, 20, 18, 25), None),%0A        (%22Auth-Access%22, %22Wu5_untagged%22, %2200:de:ad:be:ef:00%22, datetime(2017, 4, 20, 18, 20), 15),%0A        (%22Auth-Acc
 ess
+%22
 , 
-nasportid)
+%22unknown%22, %2200:de:ad:be:ef:01%22, datetime(2017, 4, 20, 18, 5), 1001),%0A        (%22Auth-Access%22, %22traffic%22, %2200:de:ad:be:ef:00%22, datetime(2017, 4, 20, 18, 0), 1001),%0A    %5D%5B:limit
 %5D%0A

Implement correct function signature in dummy API and sleep trigger