mirror of
https://github.com/lutris/lutris
synced 2024-11-02 07:10:17 +00:00
Add base test for AddGameDialog
This commit is contained in:
parent
37e56d4158
commit
9cdd74b26b
4 changed files with 11 additions and 1 deletions
|
@ -154,7 +154,6 @@ class AddGameDialog(Gtk.Dialog, GameDialogCommon):
|
|||
self.build_action_area("Add", self.on_save)
|
||||
|
||||
self.show_all()
|
||||
self.run()
|
||||
|
||||
def on_runner_changed(self, widget):
|
||||
"""Action called when runner drop down is changed."""
|
||||
|
|
|
@ -330,12 +330,14 @@ class LutrisWindow(object):
|
|||
def add_game(self, _widget, _data=None):
|
||||
"""Add a new game."""
|
||||
add_game_dialog = AddGameDialog(self)
|
||||
add_game_dialog.run()
|
||||
if add_game_dialog.runner_name and add_game_dialog.slug:
|
||||
self.add_game_to_view(add_game_dialog.slug)
|
||||
|
||||
def add_manually(self, *args):
|
||||
game = Game(self.view.selected_game)
|
||||
add_game_dialog = AddGameDialog(self, game)
|
||||
add_game_dialog.run()
|
||||
if add_game_dialog.runner_name:
|
||||
self.view.update_image(game.slug, is_installed=True)
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ def fetch_script(window, game_ref):
|
|||
if dlg.result == 1:
|
||||
game = Game(game_ref)
|
||||
game_dialog = AddGameDialog(window, game)
|
||||
game_dialog.run()
|
||||
if game_dialog.runner_name:
|
||||
window.notify_install_success()
|
||||
elif dlg.result == 2:
|
||||
|
|
8
tests/test_dialogs.py
Normal file
8
tests/test_dialogs.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from lutris.gui import config_dialogs
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class TestGameDialog(TestCase):
|
||||
def test_dialog(self):
|
||||
dlg = config_dialogs.AddGameDialog(None)
|
||||
self.assertEqual(dlg.notebook.get_current_page(), 0)
|
Loading…
Reference in a new issue