Esempio n. 1
0
    def testCaptureProfile(self):
        profiler = TFProfiler()
        environ = dict(QUERY_STRING="?service_addr=myhost1,myhost2&someotherdata=5")
        start_response = None

        resp = profiler.capture_profile_wrapper(environ, start_response)
        assert resp[0].status_code == 200
Esempio n. 2
0
    def testCaptureProfileNoCluster(self):
        profiler = TFProfiler()

        environ = dict(QUERY_STRING="?service_addr=myhost1,myhost2&someotherdata=5")
        start_response = None
        tf_profiler.environment_variables.cluster_spec = {"cluster": {}}

        resp = profiler.capture_profile_wrapper(environ, start_response)

        assert resp.status_code == 500