Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 20d13fd

Browse files
committed
[test] allow env variable for opencti configuration in tests
1 parent 22f4979 commit 20d13fd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/conftest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
@fixture(scope="session")
1414
def api_client(pytestconfig):
1515
if pytestconfig.getoption("--drone"):
16-
return OpenCTIApiClient(
17-
"http://opencti:4000",
18-
"bfa014e0-e02e-4aa6-a42b-603b19dcf159",
19-
ssl_verify=False,
20-
)
16+
api_url = os.getenv("OPENCTI_API_URL", "http://opencti:4000")
17+
api_token = os.getenv("OPENCTI_API_TOKEN", "bfa014e0-e02e-4aa6-a42b-603b19dcf159")
2118
else:
22-
return OpenCTIApiClient(
23-
"http://localhost:4000",
24-
"d434ce02-e58e-4cac-8b4c-42bf16748e84",
19+
api_url = os.getenv("OPENCTI_API_URL", "http://localhost:4000")
20+
api_token = os.getenv("OPENCTI_API_TOKEN", "d434ce02-e58e-4cac-8b4c-42bf16748e84")
21+
22+
return OpenCTIApiClient(
23+
api_url,
24+
api_token,
2525
ssl_verify=False,
2626
)
2727

0 commit comments

Comments
 (0)