From 2c0cf2e0c933b16a107cc29451ad92d3a48bb481 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 5 Dec 2023 12:08:15 +0100 Subject: tests: Modernize test scripts by using argparse and pathlib and removing Python 2 specific code. --- test/CheckOptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/CheckOptions.py') diff --git a/test/CheckOptions.py b/test/CheckOptions.py index faf1630e..cdd9b244 100755 --- a/test/CheckOptions.py +++ b/test/CheckOptions.py @@ -4,6 +4,7 @@ import re import os import sys import shlex +import pathlib import argparse import subprocess @@ -11,6 +12,15 @@ from os.path import * from subprocess import Popen, PIPE class CheckOptions (object): + @staticmethod + def parser(): + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument('-l', '--ledger', type=pathlib.Path, required=True, + help='the path to the ledger executable to test with') + parser.add_argument('-s', '--source', type=pathlib.Path, required=True, + help='the path to the top level ledger source directory') + return parser + def __init__(self, args): self.option_pattern = None self.source_file = None -- cgit v1.2.3