Пример #1
0
def test_export_output():
    import json
    file_path = '/tmp/test_export_output.json'
    output = {'a': '1', 'b': '2', 'c': '3'}  # make this more realistic
    export.export_output(output, file_path=file_path)
    with open(file_path) as f:
        data = f.read()
    assert output == json.loads(data)
Пример #2
0
def test_export_output_2():
    import json
    file_path = 'tmp/test_export_output_2.xml'
    notJsonOutput = 674
    try:
        export.export_output(notJsonOutput, file_path=file_path)
    except KeyError:
        assert True
    with open(file_path) as f:
        data = f.read()
    assert notJsonOutput == json.loads(data)
Пример #3
0
def test_export_output_2():
    import json
    file_path = 'tmp/test_export_output_2.xml'
    notJsonOutput = 674
    try:
        export.export_output(notJsonOutput, file_path=file_path)
    except KeyError:
        assert True
    with open(file_path) as f:
        data = f.read()
    assert notJsonOutput == json.loads(data)
Пример #4
0
def test_export_output():
    import json
    file_path = 'tmp/test_export_output.json'  # tmp folder needed to be created
    output = {
        "filters": {
            "aliasesothernames": [
                "Alice Josephine Barry", "Angela Ferreri, Angela Ferrara",
                "Antonio Pontiliie, Antonio Pontierre"
            ],
            "birthdate": ["15", "20", "27", "30", "4"]
        }
    }  # make this more realistic
    export.export_output(output, file_path=file_path)
    with open(file_path) as f:
        data = f.read()
    assert output == json.loads(data)
Пример #5
0
def test_export_output():
    import json
    file_path = 'tmp/test_export_output.json'  # tmp folder needed to be created
    output = {
        "filters": {
            "aliasesothernames": [
                "Alice Josephine Barry",
                "Angela Ferreri, Angela Ferrara",
                "Antonio Pontiliie, Antonio Pontierre"
            ],
            "birthdate": [
                "15",
                "20",
                "27",
                "30",
                "4"
            ]
        }
    }  # make this more realistic
    export.export_output(output, file_path=file_path)
    with open(file_path) as f:
        data = f.read()
    assert output == json.loads(data)