Example #1
0
def test_raise_on_remote_server_restore():
    provider = MsSqlProvider("192.168.2.1",
                             "username",
                             "password",
                             "dbname",
                             driver="driver")
    with pytest.raises(DependencyError):
        provider.restore_database("./local.bak")
Example #2
0
def test_raise_on_remote_server_backup():
    provider = MsSqlProvider("192.168.2.1",
                             "username",
                             "password",
                             "dbname",
                             driver="driver")
    with pytest.raises(DependencyError):
        provider.dump_database("./output.bak")
Example #3
0
def test_detect_drivers__when_many_drivers__should_connect_with_highest_numbered(
        drivers, connect):
    provider = MsSqlProvider("192.168.2.1", "username", "password", "dbname")
    provider.drop_database()

    connect.assert_any_call(driver="{ODBC Driver 17 for SQL Server}",
                            server="192.168.2.1,1433",
                            uid="username",
                            pwd="password",
                            autocommit=True)
Example #4
0
def provider_with_compression():
    return MsSqlProvider(None,
                         "DB_USER",
                         "DB_PASS",
                         "DB_NAME",
                         driver="testdriver",
                         backup_compression=True)
Example #5
0
def test_detect_drivers__when_no_drivers__raises_dependencyerror(drivers):
    with pytest.raises(DependencyError):
        MsSqlProvider("192.168.2.1", "username", "password", "dbname")
Example #6
0
def provider():
    return MsSqlProvider(None,
                         "DB_USER",
                         "DB_PASS",
                         "DB_NAME",
                         driver="testdriver")
Example #7
0
def test_raise_on_remote_server():
    with pytest.raises(DependencyError):
        MsSqlProvider("192.168.2.1", "username", "password", "dbname")
Example #8
0
def provider():
    return MsSqlProvider(None, "DB_USER", "DB_PASS", "DB_NAME")