Fix json overwriting if you have >1 PS4 connected (#35778)
This commit is contained in:
parent
e94228fddf
commit
2f6ffe7068
4 changed files with 16 additions and 16 deletions
|
@ -201,7 +201,7 @@ def test_games_reformat_to_dict(hass):
|
|||
), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
):
|
||||
mock_games = ps4.load_games(hass)
|
||||
mock_games = ps4.load_games(hass, MOCK_ENTRY_ID)
|
||||
|
||||
# New format is a nested dict.
|
||||
assert isinstance(mock_games, dict)
|
||||
|
@ -223,7 +223,7 @@ def test_load_games(hass):
|
|||
), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
):
|
||||
mock_games = ps4.load_games(hass)
|
||||
mock_games = ps4.load_games(hass, MOCK_ENTRY_ID)
|
||||
|
||||
assert isinstance(mock_games, dict)
|
||||
|
||||
|
@ -242,7 +242,7 @@ def test_loading_games_returns_dict(hass):
|
|||
), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
):
|
||||
mock_games = ps4.load_games(hass)
|
||||
mock_games = ps4.load_games(hass, MOCK_ENTRY_ID)
|
||||
|
||||
assert isinstance(mock_games, dict)
|
||||
assert not mock_games
|
||||
|
@ -252,7 +252,7 @@ def test_loading_games_returns_dict(hass):
|
|||
), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
):
|
||||
mock_games = ps4.load_games(hass)
|
||||
mock_games = ps4.load_games(hass, MOCK_ENTRY_ID)
|
||||
|
||||
assert isinstance(mock_games, dict)
|
||||
assert not mock_games
|
||||
|
@ -260,7 +260,7 @@ def test_loading_games_returns_dict(hass):
|
|||
with patch("homeassistant.components.ps4.load_json", return_value=[]), patch(
|
||||
"homeassistant.components.ps4.save_json", side_effect=MagicMock()
|
||||
), patch("os.path.isfile", return_value=True):
|
||||
mock_games = ps4.load_games(hass)
|
||||
mock_games = ps4.load_games(hass, MOCK_ENTRY_ID)
|
||||
|
||||
assert isinstance(mock_games, dict)
|
||||
assert not mock_games
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue