From 6cd5d9fcaa9212ad4b990edacf2470739fc5aa04 Mon Sep 17 00:00:00 2001 From: Michael Sekamanya Date: Thu, 4 Apr 2024 20:16:56 -0700 Subject: [PATCH] Remove api keys --- nesis/api/tests/core/controllers/test_datasources.py | 5 ++--- nesis/api/tests/core/controllers/test_management_roles.py | 2 +- nesis/api/tests/core/controllers/test_management_users.py | 7 +------ nesis/api/tests/core/controllers/test_predictions.py | 4 ++-- nesis/api/tests/core/services/test_management.py | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/nesis/api/tests/core/controllers/test_datasources.py b/nesis/api/tests/core/controllers/test_datasources.py index 6ba8e58..49e0806 100644 --- a/nesis/api/tests/core/controllers/test_datasources.py +++ b/nesis/api/tests/core/controllers/test_datasources.py @@ -32,7 +32,6 @@ def get_admin_session(client): "email": tests.admin_email, } # Create an admin user - # self.cloud_app.post(f"/v1/users", headers=tests.get_header(), data=json.dumps(admin_data)) return client.post( f"/v1/sessions", headers=tests.get_header(), data=json.dumps(admin_data) ).json @@ -45,8 +44,8 @@ def test_datasources(client): "name": "finance6", "connection": { "user": "caikuodda", - "password": "Ze1kiepeemae6Oor0the", - "host": "resource-3372014368-postgres.ametnes-7706709222-8087383694", + "password": "some.password", + "host": "localhost", "port": "5432", "database": "initdb", }, diff --git a/nesis/api/tests/core/controllers/test_management_roles.py b/nesis/api/tests/core/controllers/test_management_roles.py index a8c6d18..85357cd 100644 --- a/nesis/api/tests/core/controllers/test_management_roles.py +++ b/nesis/api/tests/core/controllers/test_management_roles.py @@ -19,7 +19,7 @@ def client(): session: Session = DBSession() tests.clear_database(session) - os.environ["OPENAI_API_KEY"] = "sk-1fxWby2iaMsmITYpb4Kr" + os.environ["OPENAI_API_KEY"] = "some.api.key" services.init_services(tests.config) return cloud_app.test_client() diff --git a/nesis/api/tests/core/controllers/test_management_users.py b/nesis/api/tests/core/controllers/test_management_users.py index 3bbd4ac..145e738 100644 --- a/nesis/api/tests/core/controllers/test_management_users.py +++ b/nesis/api/tests/core/controllers/test_management_users.py @@ -19,7 +19,7 @@ def client(): session: Session = DBSession() tests.clear_database(session) - os.environ["OPENAI_API_KEY"] = "sk-1fxWby2iaMsmITYpb4Kr" + os.environ["OPENAI_API_KEY"] = "some.api.key" services.init_services(tests.config) return cloud_app.test_client() @@ -85,11 +85,6 @@ def test_create_users(client): ) session = response.json - # Password not supplied - # response = self.cloud_app.post("/v1/users", headers=tests.get_header(), - # data=json.dumps({**user, 'email': 'email@domain.com'})) - # self.assertEqual(400, response.status_code, msg=response.json) - # No auth token supplied response = client.post( "/v1/users", diff --git a/nesis/api/tests/core/controllers/test_predictions.py b/nesis/api/tests/core/controllers/test_predictions.py index 317f87b..5ea71a0 100644 --- a/nesis/api/tests/core/controllers/test_predictions.py +++ b/nesis/api/tests/core/controllers/test_predictions.py @@ -42,8 +42,8 @@ def create_datasource(client, session): "name": "finance6", "connection": { "user": "caikuodda", - "password": "Ze1kiepeemae6Oor0the", - "host": "resource-3372014368-postgres.ametnes-7706709222-8087383694", + "password": "some.password", + "host": "localhost", "port": "5432", "database": "initdb", }, diff --git a/nesis/api/tests/core/services/test_management.py b/nesis/api/tests/core/services/test_management.py index ac57ea4..fed8778 100644 --- a/nesis/api/tests/core/services/test_management.py +++ b/nesis/api/tests/core/services/test_management.py @@ -49,7 +49,7 @@ def create_datasource(token: str, name: str = None) -> Datasource: "connection": { "user": "caikuodda", "password": "Ze1kiepeemae6Oor0the", - "host": "resource-3372014368-postgres.ametnes-7706709222-8087383694", + "host": "localhost", "port": "5432", "database": "initdb", },