Skip to content

Commit ebf66ae

Browse files
author
bosd
committed
fix(tests): Make binary mapper test platform-independent
The test for the binary mapper was failing on Windows due to differences in path separators. This commit fixes the test by using os.path.join to construct the expected path, ensuring the test runs correctly on all platforms.
1 parent 0a3e237 commit ebf66ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_mapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import inspect
44
import logging
5+
import os
56
from typing import Any, Callable
67
from unittest.mock import MagicMock, patch
78

@@ -434,7 +435,8 @@ def test_binary_with_path_prefix(mocker: MagicMock) -> None:
434435
)
435436
mapper_func = mapper.binary("col1", path_prefix="/my/path")
436437
mapper_func(LINE_SIMPLE, {})
437-
mock_open.assert_called_once_with("/my/path/A", "rb")
438+
expected_path = os.path.join("/my/path", "A")
439+
mock_open.assert_called_once_with(expected_path, "rb")
438440

439441

440442
def test_m2o_att_name() -> None:

0 commit comments

Comments
 (0)