def test_watchdog(self):
        done = []
        alive = True

        class FakeThread:
            def is_alive(self):
                return alive

        w = Watchdog(FakeThread(), lambda: done.append(True))
        w.start()
        time.sleep(0.2)
        self.assertTrue(w.is_alive())
        self.assertFalse(done)
        alive = False
        time.sleep(0.2)
        self.assertTrue(done)
        self.assertFalse(w.is_alive())
Calculate the value of the target parameter from a host header.
dataset/ETHPy150Open itamarst/crochet/crochet/tests/test_shutdown.py/ShutdownTests.test_watchdog--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/taskqueue/taskqueue.py/Task.__target_from_host