@@ -628,35 +628,37 @@ def test_find_steam_path_env(
628
628
assert str (steam_paths [0 ]) == str (custom_path )
629
629
assert str (steam_paths [1 ]) == str (custom_path )
630
630
631
- @pytest .mark .usefixtures ("flatpak_sandbox" )
632
- def test_find_steam_path_flatpak (self , steam_dir , steam_root , home_dir ):
631
+ @pytest .mark .parametrize (
632
+ "new_path" ,
633
+ [
634
+ ".var/app/com.valvesoftware.Steam/data/Steam" ,
635
+ "snap/steam/common/.local/share/Steam"
636
+ ]
637
+ )
638
+ def test_find_steam_path_non_native (
639
+ self , steam_dir , steam_root , home_dir , new_path ):
633
640
"""
634
- Ensure that `steam_path` and `steam_root` both point to the Flatpak
635
- installation of Steam if Flatpak installation is found.
641
+ Ensure that `steam_path` and `steam_root` both point to the Flatpak/Snap
642
+ installation of Steam if either installation is found.
636
643
637
644
Regression test for flathub/com.github.Matoking.protontricks#10
638
645
"""
639
- # Create a symlink to act as the Flatpak installation to keep the test
640
- # simple.
641
646
# Copy the existing Steam directory
642
- steam_flatpak_dir = (
643
- home_dir / ".var" / "app" / "com.valvesoftware.Steam" / "data"
644
- / "Steam"
645
- )
646
- steam_flatpak_dir .parent .mkdir (parents = True )
647
- shutil .copytree (steam_dir , steam_flatpak_dir )
647
+ steam_non_native_dir = home_dir / new_path
648
+ steam_non_native_dir .parent .mkdir (parents = True )
649
+ shutil .copytree (steam_dir , steam_non_native_dir )
648
650
649
651
steam_installations = find_steam_installations ()
650
652
steam_path , steam_root = next (
651
653
(steam_path , steam_root ) for (steam_path , steam_root ) in
652
654
steam_installations
653
- if str (steam_path ) == str (steam_flatpak_dir )
655
+ if str (steam_path ) == str (steam_non_native_dir )
654
656
)
655
657
656
658
# Since Steam Flatpak installation was found, both of its paths
657
659
# should point to the same installation directory
658
- assert str (steam_path ) == str (steam_flatpak_dir )
659
- assert str (steam_root ) == str (steam_flatpak_dir )
660
+ assert str (steam_path ) == str (steam_non_native_dir )
661
+ assert str (steam_root ) == str (steam_non_native_dir )
660
662
661
663
def test_find_steam_path_multiple_install_warning (
662
664
self , steam_dir , steam_root , home_dir , caplog ):
0 commit comments