def test_to_task(self):
        import datetime
        import time

        from google.appengine.ext import testbed

        from furious.async import Async
        from furious.async import ASYNC_ENDPOINT

        testbed = testbed.Testbed()
        testbed.activate()

        # This just drops the microseconds.  It is a total mess, but is needed
        # to handle all the rounding crap.
        eta = datetime.datetime.now() + datetime.timedelta(minutes=43)
        eta_posix = time.mktime(eta.timetuple())

        headers = {'some': 'thing', 'fun': 1}

        job = ('test', None, None)

        expected_url = "%s/%s" % (ASYNC_ENDPOINT, 'test')

        task_args = {'eta': eta_posix}
        options = {'job': job, 'headers': headers, 'task_args': task_args,
                   'id': 'ident', 'context_id': 'contextid',
                   'parent_id': 'parentid'}

        task = Async.from_dict(options).to_task()

        # App Engine sets these headers by default.
        full_headers = {
            'Host': 'testbed.example.com',
            'X-AppEngine-Current-Namespace': ''
        }
        full_headers.update(headers)

        self.assertEqual(eta_posix, task.eta_posix)
        self.assertEqual(expected_url, task.url)
        self.assertEqual(full_headers, task.headers)

        options['task_args']['eta'] = datetime.datetime.fromtimestamp(
            eta_posix)

        options['_recursion'] = {'current': 1, 'max': 100}
        options['_type'] = 'furious.async.Async'

        self.assertEqual(
            options, Async.from_dict(json.loads(task.payload)).get_options())
Close the socket = do nothing for influx which is http stateless
dataset/ETHPy150Open Workiva/furious/furious/tests/test_async.py/TestAsync.test_to_task--crossover with--dataset/ETHPy150Open BrightcoveOS/Diamond/src/diamond/handler/influxdbHandler.py/InfluxdbHandler._close