Skip to content

Commit

Permalink
Fix issue where plist file was not properly being mocked
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz00 committed Sep 7, 2024
1 parent 35f5c75 commit 24548c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_completed_property(setup_instance):

def test_is_complete(setup_instance):
with (
patch("os.path.exists", return_value=True),
patch.object(Path, "exists", return_value=True),
patch("plistlib.load", return_value={"Setup": {"first_run_done": True}}),
patch("builtins.open", mock_open(read_data=b"")),
):
Expand All @@ -54,7 +54,7 @@ def test_is_complete(setup_instance):


def test_is_complete_error(setup_instance):
with patch("os.path.exists", return_value=True):
with patch.object(Path, "exists", return_value=True):
with patch("plistlib.load", side_effect=Exception("plist read error")):
with pytest.raises(exceptions.PlistError):
setup_instance._check_completion()
Expand Down

0 comments on commit 24548c2

Please sign in to comment.