def test_parse_query(cli): arg_list = [ 'query', '-o', 'query_response.json', '-d', 'document.xml', 'query.json' ] args = cli.parse(arg_list) assert args.query_file == 'query.json' assert args.output_file == 'query_response.json' assert args.document_file == 'document.xml'
def test_parse_build(cli): arg_list = [ 'build', '-o', 'invoice.xml', '-c', 'certificate.p12', '-p', 'pass', '-t', 'tech_key', 'invoice.json' ] args = cli.parse(arg_list) assert args.input_file == 'invoice.json' assert args.output_file == 'invoice.xml' assert args.certificate == 'certificate.p12' assert args.password == 'pass' assert args.technical_key == 'tech_key'
def test_parse_verify(cli): arg_list = ['verify', './invoice.xml'] args = cli.parse(arg_list) assert args.document_file == './invoice.xml'
def test_parse_qrcode(cli): arg_list = ['qrcode', './invoice.xml', '-o', 'image.png'] args = cli.parse(arg_list) assert args.document_file == './invoice.xml' assert args.output_file == 'image.png'
def test_parse_send(cli): arg_list = ['send', 'request.json', '-o', 'response.json'] args = cli.parse(arg_list) assert args.request_file == 'request.json' assert args.output_file == 'response.json'
def test_parse_help(cli): arg_list = [] with raises(SystemExit): cli.parse(arg_list)