Exemplo n.º 1
0
def test_parse_query():
    arg_list = [
        'query', '-o', 'query_response.json', '-d', 'document.xml',
        'query.json'
    ]
    args = parse(arg_list)
    assert args.query_file == 'query.json'
    assert args.output_file == 'query_response.json'
    assert args.document_file == 'document.xml'
Exemplo n.º 2
0
def test_parse_build():
    arg_list = [
        'build', '-o', 'invoice.xml', '-c', 'certificate.p12', '-p', 'pass',
        '-t', 'tech_key', 'invoice.json'
    ]
    args = 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'
Exemplo n.º 3
0
def test_parse_query():
    arg_list = [
        "query",
        "-o",
        "query_response.json",
        "-d",
        "document.xml",
        "query.json",
    ]
    args = parse(arg_list)
    assert args.query_file == "query.json"
    assert args.output_file == "query_response.json"
    assert args.document_file == "document.xml"
Exemplo n.º 4
0
def test_parse_build():
    arg_list = [
        "build",
        "-o",
        "invoice.xml",
        "-c",
        "cert.pem",
        "-p",
        "key.pem",
        "-t",
        "tech_key",
        "invoice.json",
    ]
    args = parse(arg_list)
    assert args.input_file == "invoice.json"
    assert args.output_file == "invoice.xml"
    assert args.certificate == "cert.pem"
    assert args.private_key == "key.pem"
    assert args.technical_key == "tech_key"
Exemplo n.º 5
0
def test_parse_verify():
    arg_list = ['verify', './invoice.xml']
    args = parse(arg_list)
    assert args.document_file == './invoice.xml'
Exemplo n.º 6
0
def test_parse_send():
    arg_list = ['send', 'request.json', '-o', 'response.json']
    args = parse(arg_list)
    assert args.request_file == 'request.json'
    assert args.output_file == 'response.json'
Exemplo n.º 7
0
def test_parse_verify():
    arg_list = ["verify", "./invoice.xml"]
    args = parse(arg_list)
    assert args.document_file == "./invoice.xml"
Exemplo n.º 8
0
def test_parse_send():
    arg_list = ["send", "request.json", "-o", "response.json"]
    args = parse(arg_list)
    assert args.request_file == "request.json"
    assert args.output_file == "response.json"
Exemplo n.º 9
0
def test_parse_help():
    arg_list = []
    with raises(SystemExit):
        parse(arg_list)