From c24ab92277543835e7725463f8c5d11d8e2097e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Thu, 17 Sep 2026 14:12:42 -0300 Subject: [PATCH] [INT-3877] Read test API key from ONFLEET_API_KEY env var Remove the hardcoded API key from test/test_onfleet.py. The suite now reads ONFLEET_API_KEY and skips live-API tests when it is not set. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01UmWS7B7g3HKpoenKRaGnNu --- test/test_onfleet.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_onfleet.py b/test/test_onfleet.py index 0759d19..713cd0c 100644 --- a/test/test_onfleet.py +++ b/test/test_onfleet.py @@ -2,6 +2,7 @@ sys.path.append("../onfleet") import onfleet +import os import unittest import re from datetime import datetime, timedelta @@ -11,8 +12,12 @@ class TestOnfleet(unittest.TestCase): def setUp(self): - # Input your API key to enable test - self.api_key = "dac06dbfb5f1c94ee7f0c2cf58ef3161" + # Set the ONFLEET_API_KEY environment variable to enable this test. + # Use a key from a dedicated test organization: the suite performs + # real writes (creates and deletes admins, workers, hubs, teams). + self.api_key = os.environ.get("ONFLEET_API_KEY") + if (not self.api_key): + self.skipTest("ONFLEET_API_KEY environment variable is not set") self.api = onfleet.Onfleet(api_key=self.api_key) def test_authenticate(self):