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")
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")
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)
def provider_with_compression(): return MsSqlProvider(None, "DB_USER", "DB_PASS", "DB_NAME", driver="testdriver", backup_compression=True)
def test_detect_drivers__when_no_drivers__raises_dependencyerror(drivers): with pytest.raises(DependencyError): MsSqlProvider("192.168.2.1", "username", "password", "dbname")
def provider(): return MsSqlProvider(None, "DB_USER", "DB_PASS", "DB_NAME", driver="testdriver")
def test_raise_on_remote_server(): with pytest.raises(DependencyError): MsSqlProvider("192.168.2.1", "username", "password", "dbname")
def provider(): return MsSqlProvider(None, "DB_USER", "DB_PASS", "DB_NAME")