Skip to content

Commit

Permalink
Fixed a pathh issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshraghupathy committed Nov 13, 2024
1 parent b254b23 commit 981bad6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic-chassisd/tests/test_chassisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def test_is_first_boot_file_found_first_boot():
chassis = MockSmartSwitchChassis()
module = "DPU0"

with mock.patch("sonic_chassisd.tests.mock_platform.os.path.join", return_value="/mocked/path/to/reboot-cause.txt"):
with mock.patch("tests.mock_platform.os.path.join", return_value="/mocked/path/to/reboot-cause.txt"):
with mock.patch("builtins.open", mock.mock_open(read_data="First boot")):
result = chassis._is_first_boot(module)
assert result # Using simple assert as requested
Expand All @@ -447,7 +447,7 @@ def test_is_first_boot_file_not_found():
chassis = MockSmartSwitchChassis()
module = "DPU0"

with mock.patch("sonic_chassisd.tests.mock_platform.os.path.join", return_value="/mocked/path/to/reboot-cause.txt"):
with mock.patch("tests.mock_platform.os.path.join", return_value="/mocked/path/to/reboot-cause.txt"):
with mock.patch("builtins.open", mock.mock_open()) as mock_file:
mock_file.side_effect = FileNotFoundError
result = chassis._is_first_boot(module)
Expand Down

0 comments on commit 981bad6

Please sign in to comment.