Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue causing mount to error on read
- Loading branch information
Dave Storey
committed
Jun 15, 2020
1 parent
b8b4d86
commit a0ad67e
Showing
2 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package databricks | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestProcessAzureWasbAbfssUrisCorrectlySplitsURI(t *testing.T) { | ||
testCases := []struct { | ||
URI string | ||
ExpectedContainer string | ||
ExpectedStorageAcc string | ||
ExpectedDirectory string | ||
}{ | ||
{ | ||
URI: "abfss://wibble@mystorage.dfs.core.windows.net/wobble", | ||
ExpectedContainer: "wibble", | ||
ExpectedStorageAcc: "mystorage", | ||
ExpectedDirectory: "/wobble", | ||
}, | ||
{ | ||
URI: "abfss://wibble@mystorage.dfs.core.windows.net", | ||
ExpectedContainer: "wibble", | ||
ExpectedStorageAcc: "mystorage", | ||
ExpectedDirectory: "", | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
container, storageAcc, dir, err := ProcessAzureWasbAbfssUris(tc.URI) | ||
assert.Equal(t, tc.ExpectedContainer, container) | ||
assert.Equal(t, tc.ExpectedStorageAcc, storageAcc) | ||
assert.Equal(t, tc.ExpectedDirectory, dir) | ||
assert.Nil(t, err) | ||
} | ||
} |