示例#1
0
 def test_autoexec_cmds_and_conf(self):
     os.chdir('tests/files/confs')
     cfg = confgen.DosboxConfiguration(conf_files=['c1.conf'],
                                       commands=['cmd1', 'cmd2'])
     self.assertIn('autoexec', cfg.sections())
     self.assertEqual(cfg['autoexec'], ['echo c1',
                                        'cmd1',
                                        'cmd2'])
示例#2
0
 def test_update_sections(self):
     os.chdir('tests/files/confs')
     cfg = confgen.DosboxConfiguration(conf_files=['sb1.conf', 'sb2.conf'])
     self.assertIn('sblaster', cfg.sections())
     self.assertIn('mixer', cfg.sections())
     self.assertEqual('44100', cfg['mixer']['rate'])  # from sb2.conf
     self.assertEqual('77', cfg['sblaster']['irq'])  # from sb2.conf
     self.assertEqual('42', cfg['sblaster']['dma'])  # from sb1.conf
示例#3
0
 def test_autoexec_cmds_and_exe(self):
     os.chdir('tests/files/no_conf')
     cfg = confgen.DosboxConfiguration(exe='FILE.EXE',
                                       commands=['cmd1', 'cmd2'])
     self.assertIn('autoexec', cfg.sections())
     self.assertEqual(cfg['autoexec'], ['cmd1',
                                        'cmd2',
                                        'mount C .',
                                        'C:',
                                        'file.exe'])
示例#4
0
 def test_gog_warcraft(self):
     os.chdir('tests/files/gog/warcraft_orcs_and_humans/DOSBOX')
     cmd_line = ['-conf', '..\\dosbox_warcraft.conf',
                 '-conf', '..\\dosbox_warcraft_single.conf',
                 '-noconsole', '-c', 'exit']
     args = confgen.parse_dosbox_arguments(cmd_line)
     conf = confgen.DosboxConfiguration(conf_files=(args.conf or []),
                                        commands=args.c,
                                        exe=args.file,
                                        noautoexec=args.noautoexec,
                                        exit_after_exe=args.exit)
     # at the very least, autoexec should be filled
     self.assertEqual(conf.encoding, 'cp1250')
示例#5
0
 def test_autoexec_from_conf_3(self):
     os.chdir('tests/files/confs')
     cfg = confgen.DosboxConfiguration(conf_files=['C1.conf'])
     self.assertIn('autoexec', cfg.sections())
     self.assertEqual(cfg['autoexec'], ['echo c1'])
示例#6
0
 def test_autoexec_single_bat(self):
     os.chdir('tests/files/no_conf')
     cfg = confgen.DosboxConfiguration(exe='file.bat')
     self.assertIn('autoexec', cfg.sections())
     self.assertEqual(cfg['autoexec'], ['mount C .', 'C:', 'call file.bat'])
示例#7
0
 def test_autoexec_with_commands(self):
     os.chdir('tests/files/no_conf')
     cfg = confgen.DosboxConfiguration(commands=['foo', 'bar'])
     self.assertIn('autoexec', cfg.sections())
     self.assertEqual(cfg['autoexec'], ['foo', 'bar'])
示例#8
0
 def test_autoexec_no_autoexec(self):
     os.chdir('tests/files/confs')
     cfg = confgen.DosboxConfiguration(conf_files=['no_autoexec.conf',
                                                   'empty_autoexec.conf'])
     self.assertEqual(cfg['autoexec'], [])
示例#9
0
 def test_autoexec_default_3(self):
     os.chdir('tests/files/case')
     cfg = confgen.DosboxConfiguration(commands=['foo'])
     self.assertEqual(cfg['autoexec'], ['echo dOsBoX', 'foo'])
示例#10
0
 def test_autoexec_default_2(self):
     os.chdir('tests/files/default')
     cfg = confgen.DosboxConfiguration(conf_files=['c.conf'])
     self.assertEqual(cfg['autoexec'], ['cmd'])
示例#11
0
 def test_autoexec_default_1(self):
     os.chdir('tests/files/default')
     cfg = confgen.DosboxConfiguration(commands=['cmd'])
     self.assertEqual(cfg['autoexec'], ['echo dosbox', 'cmd'])