mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
add some unit tests
This commit is contained in:
parent
15dd5ce5f6
commit
f6a240b7be
@ -17,6 +17,7 @@ namespace DB::S3
|
||||
* The following patterns are allowed:
|
||||
* s3://bucket/key
|
||||
* http(s)://endpoint/bucket/key
|
||||
* TODO specify aws private link
|
||||
*/
|
||||
struct URI
|
||||
{
|
||||
|
@ -74,6 +74,26 @@ const TestCase TestCases[] = {
|
||||
"data",
|
||||
"",
|
||||
true},
|
||||
{S3::URI("https://bucket.vpce-07a1cd78f1bd55c5f-j3a3vg6w.s3.us-east-1.vpce.amazonaws.com/root/nested/file.txt"),
|
||||
"https://bucket.vpce-07a1cd78f1bd55c5f-j3a3vg6w.s3.us-east-1.vpce.amazonaws.com",
|
||||
"root",
|
||||
"nested/file.txt",
|
||||
"",
|
||||
true},
|
||||
// Test with a file with no extension
|
||||
{S3::URI("https://bucket.vpce-03b2c987f1bd55c5f-j3b4vg7w.s3.ap-southeast-2.vpce.amazonaws.com/some_bucket/document"),
|
||||
"https://bucket.vpce-03b2c987f1bd55c5f-j3b4vg7w.s3.ap-southeast-2.vpce.amazonaws.com",
|
||||
"some_bucket",
|
||||
"document",
|
||||
"",
|
||||
true},
|
||||
// Test with a deeply nested file path
|
||||
{S3::URI("https://bucket.vpce-0242cd56f1bd55c5f-l5b7vg8x.s3.sa-east-1.vpce.amazonaws.com/some_bucket/b/c/d/e/f/g/h/i/j/data.json"),
|
||||
"https://bucket.vpce-0242cd56f1bd55c5f-l5b7vg8x.s3.sa-east-1.vpce.amazonaws.com",
|
||||
"some_bucket",
|
||||
"b/c/d/e/f/g/h/i/j/data.json",
|
||||
"",
|
||||
true},
|
||||
};
|
||||
|
||||
class S3UriTest : public testing::TestWithParam<std::string>
|
||||
|
Loading…
Reference in New Issue
Block a user