Exemplo n.º 1
0
def test_non_existent_file(caplog):
    config = [BASEPATH + 'configs/nonexistent_config.json']
    sql_judge(config)
    assert caplog.record_tuples[0] == (
        'root', logging.ERROR,
        "File 'test/integration/configs/nonexistent_config.json' could not be found"
    )
Exemplo n.º 2
0
def test_cli_export():
    config = [BASEPATH + 'configs/config.json']
    assert sql_judge(config) == [
        'REPORT', '=' * 50, 'table:', '=' * 50, ' + invalid_table',
        '   + Invalid', '-' * 40, 'column:', '=' * 50,
        ' + invalid_table.invalid_column', '   + Invalid', '-' * 40
    ]
Exemplo n.º 3
0
def test_plugin_adapter():
    config = [BASEPATH + 'configs/plugin_config.json']
    assert sql_judge(config) == [
        'REPORT', '=' * 50, 'table:', '=' * 50, ' + invalid_table',
        '   + Invalid', '-' * 40, 'column:', '=' * 50,
        ' + invalid_table.invalid_column', '   + Invalid', '-' * 40
    ]
Exemplo n.º 4
0
def test_csv_export():
    config = [
        BASEPATH + 'configs/config.json', BASEPATH + 'configs/config_csv.json'
    ]
    assert sql_judge(config) == [
        'Table, invalid_table, Invalid',
        'Column, invalid_table.invalid_column, Invalid'
    ]
Exemplo n.º 5
0
def test_nonexisten_plugin(caplog):
    config = [BASEPATH + 'configs/plugin_does_not_exist_config.json']
    sql_judge(config)
    assert caplog.record_tuples[0] == (
        'root', logging.ERROR,
        "Could not find plugin with 'nonexistent_adapter' ID")
Exemplo n.º 6
0
def test_invalid_configuration(caplog):
    config = [BASEPATH + 'configs/invalid_config.json']
    sql_judge(config)
    assert caplog.record_tuples[0] == (
        'root', logging.ERROR,
        "Error while parsing 'test/integration/configs/invalid_config.json'")
Exemplo n.º 7
0
def test_empty_configuration(caplog):
    config = [BASEPATH + 'configs/empty_config.json']
    sql_judge(config)
    assert caplog.record_tuples[0] == (
        'root', logging.ERROR, 'Builder could not resolve Adapter Type')
Exemplo n.º 8
0
def test_no_configuration(caplog):
    sql_judge([])
    assert caplog.record_tuples[0] == (
        'root', logging.ERROR,
        'At least one configuration file must be provided')
Exemplo n.º 9
0
def test_empty_configuration(caplog):
    config = [BASEPATH + 'configs/empty_config.json']
    sql_judge(config)
    assert caplog.record_tuples[0] == ('root', logging.ERROR, 'Adapter Module not provided')