Fix tests

This commit is contained in:
Mathieu Comandon 2013-03-20 21:46:34 +01:00
parent e7e8460f53
commit 3a25e79f99
3 changed files with 22 additions and 24 deletions

View file

@ -60,8 +60,8 @@ class uae(Runner):
]
self.game_options = [{
"option": "disk",
"type":"multiple",
"label":"Floppies"
"type": "multiple",
"label": "Floppies"
}]
self.runner_options = [
@ -72,28 +72,28 @@ class uae(Runner):
},
{
"option": "x11.floppy_path",
"label":"Floppy path",
"label": "Floppy path",
"type": "directory_chooser"
},
{
"option": "use_gui",
"label": "Show UAE gui",
"type":"bool"
"type": "bool"
},
{
"option": "gfx_fullscreen_amiga",
"label": "Fullscreen (F12 + s to Switch)",
"type":"bool"
"type": "bool"
},
{
"option": "gfx_show_leds_fullscreen",
"label": "Show LEDs",
"type":"bool"
"type": "bool"
},
{
"option": "machine",
"label":"Type of Amiga",
"type":"one_choice",
"label": "Type of Amiga",
"type": "one_choice",
"choices": [(choice.values()[0], choice.keys()[0])
for choice in amiga_choices]
},
@ -105,7 +105,7 @@ class uae(Runner):
},
{
"option": "joyport1",
"label":"Player 2 Control",
"label": "Player 2 Control",
"type": "one_choice",
"choices": control_choices
},

View file

@ -1,23 +1,21 @@
#!/usr/bin/python
import unittest
import os
from lutris.settings import PGA_DB
from lutris import settings
from lutris import pga
TEST_PGA_PATH = os.path.join(os.path.dirname(__file__), 'fixtures/pga.db')
class TestPersonnalGameArchive(unittest.TestCase):
def test_database(self):
pga_path = os.path.join(os.path.expanduser('~'),
".local/share/lutris/pga.db")
self.assertEqual(PGA_DB, pga_path)
self.assertTrue(os.path.exists(PGA_DB))
def setUp(self):
settings.PGA_DB = TEST_PGA_PATH
def test_add_game(self):
pga.add_game(name="LutrisTest", machine="Linux", runner="Linux")
game_list = pga.get_games()
print(game_list)
#self.assertTrue("LutrisTest" in game_list)
game_names = [item[1] for item in game_list]
self.assertTrue("LutrisTest" in game_names)
def test_delete_game(self):
pga.delete_game("LutrisTest")

View file

@ -23,9 +23,9 @@ class TestUae(TestCase):
}
}
uae_runner = uae.uae(config)
uae_runner.insert_floppies()
self.assertIn('floppy0', uae_runner.uae_options)
self.assertNotIn('floppy1', uae_runner.uae_options)
disks = uae_runner.insert_floppies()
self.assertIn('floppy0', disks)
self.assertNotIn('floppy1', disks)
# Two disks, two floppy drives
config = {
@ -37,9 +37,9 @@ class TestUae(TestCase):
}
}
uae_runner = uae.uae(config)
uae_runner.insert_floppies()
self.assertIn('floppy0', uae_runner.uae_options)
self.assertIn('floppy1', uae_runner.uae_options)
disks = uae_runner.insert_floppies()
self.assertIn('floppy0', disks)
self.assertIn('floppy1', disks)
# Zero disk, two floppy drives
config = {