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')
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')
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))
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')
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.')
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')
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]'))
def test_main_09(self): try: padpt.main() except SystemExit as e: self.assertEqual(str(e), '覚醒エラー is undefined in alias.csv.')
def test_main_08(self): try: padpt.main() except SystemExit as e: self.assertEqual(str(e), 'tests/in/pterror.pt has a syntax error.')
def test_main_07(self): try: padpt.main() except SystemExit as e: self.assertEqual(str(e), 'none.pt does not exist.')