def get_service(self, project=None):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, ROOT_URL, json=ROOT_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("query", project=project)
        return svc
    def get_service(self):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, WORKFLOW_URL, json=ROOT_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("workflow")
        return svc
    def get_service(self):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, PIPELINES_URL, json=ROOT_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("pipelines")
        return svc
    def get_service(self):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, PHENOTYPE_URL, json=ROOT_RESP)
        responses.add(responses.GET, PROJECTS_URL, json=PROJECTS_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("phenotype", project=PROJECT)
        return svc
Esempio n. 5
0
    def test_client(self):
        with self.assertRaises(InvalidProfile):
            _ = Client(profile="dummy")
        cfg.get("profiles")["dummy"] = {}
        client = Client(profile="dummy")

        with self.assertRaises(ServiceNotFound):
            svc = client.service("notfound")
    def get_service(self):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, ROOT_URL, json=ROOT_RESP)
        responses.add(responses.GET,
                      PROJECTS_URL + "?project_name=testing",
                      json=PROJECTS_RESP)
        responses.add(responses.GET, USER_URL, json=USER_RESP)
        responses.add(responses.GET, CREDENTIALS_URL, json=CREDENTIALS_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("project", project="testing")
        return svc
Esempio n. 7
0
    def test_workflow(self):
        responses.add(responses.POST, AUTH_URL, json=AUTH_RESP)
        responses.add(responses.GET, WORKFLOW_URL, json=ROOT_RESP)

        client = Client(api_key=REFRESH_TOKEN)
        svc = client.service("workflow")
        svc.status()
        svc.status(force=True)
        ret = svc.endpoints

        responses.add(responses.GET, WORKFLOW_URL + "/documentation", json={})
        ret = svc.openapi_spec()

        with responses.RequestsMock(
                assert_all_requests_are_fired=False) as rsps:
            rsps.add(responses.GET, WORKFLOW_URL + "/health")
            ret = svc.healthy()
            self.assertTrue(ret)

        with responses.RequestsMock(
                assert_all_requests_are_fired=False) as rsps:
            rsps.add(responses.GET, WORKFLOW_URL + "/health", status=404)
            ret = svc.healthy()
            self.assertFalse(ret)