about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-07-03 20:59:12 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-07-03 20:59:12 +0300
commit3d97f07f9ca98f88140b2facc33d44df6c6f0fbf (patch)
tree4549f704854a22861b1d1355915f7424bc711353
parentc79cf21cd27dfed67d064b515a58ad6ef9aa499a (diff)
downloadfungus-launcher-3d97f07f9ca98f88140b2facc33d44df6c6f0fbf.tar.gz
fungus-launcher-3d97f07f9ca98f88140b2facc33d44df6c6f0fbf.tar.xz
pyright unhappy
-rw-r--r--tests/test_game_model.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_game_model.py b/tests/test_game_model.py
index 190f52e..18a32f1 100644
--- a/tests/test_game_model.py
+++ b/tests/test_game_model.py
@@ -197,6 +197,7 @@ class TestGameLibrary:
         library = GameLibrary(str(sample_games_dir))
         assert library.update_field("umu-1234", "favorite", False) is True
         game = library.load("umu-1234")
+        assert game is not None
         assert game.favorite is False
 
     def test_update_field_nonexistent(self, sample_games_dir):
@@ -215,6 +216,7 @@ class TestGameLibrary:
         assert library.add(game) is False
         # Original still intact
         original = library.load("umu-1234")
+        assert original is not None
         assert original.title == "Test Game Alpha"
 
     def test_save_all(self, tmp_path):
@@ -226,8 +228,12 @@ class TestGameLibrary:
         library.save_all(games)
         assert library.exists("a")
         assert library.exists("b")
-        assert library.load("a").title == "A"
-        assert library.load("b").title == "B"
+        game_a = library.load("a")
+        assert game_a is not None
+        assert game_a.title == "A"
+        game_b = library.load("b")
+        assert game_b is not None
+        assert game_b.title == "B"
 
     def test_atomic_write_crash_safety(self, tmp_path):
         """Verify writes use temp files (no partial .ini left on crash)."""
@@ -313,7 +319,9 @@ class TestMigrateToPerGame:
         library = GameLibrary(str(games_dir))
         assert library.exists("umu-1234")
         assert library.exists("umu-5678")
-        assert library.load("umu-1234").title == "Test Game Alpha"
+        loaded = library.load("umu-1234")
+        assert loaded is not None
+        assert loaded.title == "Test Game Alpha"
 
     def test_migrate_empty_json(self, tmp_path):
         games_json = tmp_path / "games.json"
@@ -353,6 +361,7 @@ class TestMigrateToPerGame:
         assert result.skipped_duplicate == 1
         library = GameLibrary(str(games_dir))
         game = library.load("dup")
+        assert game is not None
         assert game.title == "First"  # first occurrence wins
 
     def test_migrate_dry_run(self, tmp_path, sample_games):