Exemplo n.º 1
0
 def test_main_05(self):
     shutil.copy('tests/.padpt/padpt_keyerror.conf',
                 os.path.join(self.conf_dir, 'padpt.conf'))
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), 'There is an error in padpt.conf')
Exemplo n.º 2
0
 def test_main_06(self):
     shutil.copy('tests/.padpt/padpt_urlerror.conf',
                 os.path.join(self.conf_dir, 'padpt.conf'))
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), 'Failed to download http://padpt_test')
Exemplo n.º 3
0
 def test_main_03(self):
     padpt_conf = os.path.join(self.conf_dir, 'padpt.conf')
     os.remove(padpt_conf)
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), '{} does not exist.'.format(padpt_conf))
Exemplo n.º 4
0
 def test_main_01(self):
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         padpt.main()
         Image.open('tests/in/mill.png').show()
         self.assertEqual('y', input('OK? [y/n]'))
     os.remove('tests/in/mill.png')
Exemplo n.º 5
0
 def test_main_10(self):
     shutil.copy('tests/data/db/monstererror.csv',
                 os.path.join(self.db_dir, 'monsters.csv'))
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(
             str(e), 'The monster whose monster ID is 2903'
             'is not registerd with your monster DB.')
Exemplo n.º 6
0
 def test_main_00(self):
     padpt.main()
     self.assertEqual(
         sys.stdout.getvalue(), 'usage: padpt [-h] [-u] [pt] [out]\n'
         '\n'
         'generates a walkthrough sheet.\n'
         '\n'
         'positional arguments:\n'
         '  pt            pt file to be parsed\n'
         '  out           path of the output file\n'
         '\n'
         'optional arguments:\n'
         '  -h, --help    show this help message and exit\n'
         '  -u, --update  updates database\n')
Exemplo n.º 7
0
 def test_main_02(self):
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         padpt.main()
         Image.open('tests/out/testpadpt_02.png').show()
         self.assertEqual('y', input('OK? [y/n]'))
Exemplo n.º 8
0
 def test_main_09(self):
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), '覚醒エラー is undefined in alias.csv.')
Exemplo n.º 9
0
 def test_main_08(self):
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), 'tests/in/pterror.pt has a syntax error.')
Exemplo n.º 10
0
 def test_main_07(self):
     try:
         padpt.main()
     except SystemExit as e:
         self.assertEqual(str(e), 'none.pt does not exist.')