Skip to content

Commit 2f5cfe4

Browse files
committed
test: fix current tests
1 parent e9e7ae2 commit 2f5cfe4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/unit/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
import json
22
import socket
3+
import sys
4+
import os.path as op
35
from contextlib import closing
46
from http.server import BaseHTTPRequestHandler, HTTPServer
57
from threading import Thread
8+
from unittest.mock import MagicMock
69

710
import pytest
811

912

13+
cur_dir = op.dirname(op.abspath(__file__))
14+
15+
mock_msp = MagicMock(return_value=op.sep.join([cur_dir, "data/mock_log"]))
16+
mock_bundle_paths = MagicMock()
17+
mock_bundle_paths.make_splunkhome_path = mock_msp
18+
19+
sys.modules["splunk.clilib.bundle_paths"] = mock_bundle_paths
20+
21+
1022
@pytest.fixture(scope="session")
1123
def http_mock_server():
1224
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:

0 commit comments

Comments
 (0)