|
1 | 1 | import os
|
| 2 | +import sys |
2 | 3 | import shutil
|
3 | 4 | from pathlib import Path
|
4 | 5 |
|
@@ -334,15 +335,6 @@ def test_run_winetricks_game_not_found(
|
334 | 335 |
|
335 | 336 | assert "Steam app with the given app ID could not be found" in result
|
336 | 337 |
|
337 |
| - def test_run_no_command(self, cli): |
338 |
| - """ |
339 |
| - Run only the 'protontricks' command. |
340 |
| - """ |
341 |
| - result = cli([]) |
342 |
| - |
343 |
| - # Help will be printed if no specific command is given |
344 |
| - assert result.startswith("usage: ") |
345 |
| - |
346 | 338 | @pytest.mark.usefixtures("default_proton")
|
347 | 339 | def test_run_returncode_passed(self, cli, steam_app_factory):
|
348 | 340 | """
|
@@ -780,6 +772,23 @@ def test_run_gui_proton_incomplete(
|
780 | 772 |
|
781 | 773 | assert "Proton installation is incomplete" in result
|
782 | 774 |
|
| 775 | + @pytest.mark.usefixtures("default_proton", "gui_provider") |
| 776 | + def test_run_no_args( |
| 777 | + self, cli, steam_app_factory, command_mock, gui_provider, |
| 778 | + monkeypatch): |
| 779 | + """ |
| 780 | + Run only the 'protontricks' command. This will default to GUI. |
| 781 | + """ |
| 782 | + # Monkeypatch 'sys.argv', as that seems to be the only way to determine |
| 783 | + # whether no arguments were provided |
| 784 | + monkeypatch.setattr(sys, "argv", ["protontricks"]) |
| 785 | + steam_app_factory(name="Fake game", appid=10) |
| 786 | + |
| 787 | + result = cli([], expect_returncode=1) |
| 788 | + |
| 789 | + # Help will be printed if no specific command is given |
| 790 | + assert "No game was selected" in result |
| 791 | + |
783 | 792 |
|
784 | 793 | class TestCLICommand:
|
785 | 794 | def test_run_command(
|
|
0 commit comments