def test_normal_nopath(capsys): argv = ['./304pacman', 'tests/deps/map_nopath', '+', ' '] argMan = Pacman(argv[2], argv[3]).run(argv[1]) redir = capsys.readouterr() assert redir.out == "{}\n".format(MAP_NOPATH_OUTPUT)
def test_tricky_case(capsys): argv = ['./304pacman', 'tests/deps/map2', '@', ' '] argMan = Pacman(argv[2], argv[3]).run(argv[1]) redir = capsys.readouterr() assert redir.out == "{}\n".format(MAP2_OUTPUT)
def main(): argsManager = ArgumentManager() if argsManager.needHelp(argv): Usage() elif argsManager.checkArgs(argv) == 84: exit(84) else: Pacman(argv[2], argv[3]).run(argv[1])
def test_several_pacmen(capsys): argv = ['./304pacman', 'tests/deps/map2pacmen', '+', ' '] try: argMan = Pacman(argv[2], argv[3]).run(argv[1]) except SystemExit: redir = capsys.readouterr() assert redir.out == "Too many pacmans.\n" else: assert True is False # Test has failed
def test_no_ghost(capsys): argv = ['./304pacman', 'tests/deps/mapNoGhost', '+', ' '] try: argMan = Pacman(argv[2], argv[3]).run(argv[1]) except SystemExit: redir = capsys.readouterr() assert redir.out == "No ghost in map.\n" else: assert True is False # Test has failed