(t *testing.T)
| 417 | } |
| 418 | |
| 419 | func TestParseURI_BasicS3(t *testing.T) { |
| 420 | t.Parallel() |
| 421 | cstr := "profile:s3://bucket/path/to/file" |
| 422 | c, err := connparse.ParseURI(cstr) |
| 423 | if err != nil { |
| 424 | t.Fatalf("failed to parse URI: %v", err) |
| 425 | } |
| 426 | expected := "path/to/file" |
| 427 | if c.Path != expected { |
| 428 | t.Fatalf("expected path to be \"%q\", got \"%q\"", expected, c.Path) |
| 429 | } |
| 430 | expected = "bucket" |
| 431 | if c.Host != expected { |
| 432 | t.Fatalf("expected host to be \"%q\", got \"%q\"", expected, c.Host) |
| 433 | } |
| 434 | expected = "bucket/path/to/file" |
| 435 | pathWithHost := c.GetPathWithHost() |
| 436 | if pathWithHost != expected { |
| 437 | t.Fatalf("expected path with host to be \"%q\", got \"%q\"", expected, pathWithHost) |
| 438 | } |
| 439 | expected = "s3" |
| 440 | if c.GetType() != expected { |
| 441 | t.Fatalf("expected conn type to be \"%q\", got \"%q\"", expected, c.GetType()) |
| 442 | } |
| 443 | if len(c.GetSchemeParts()) != 2 { |
| 444 | t.Fatalf("expected scheme parts to be 2, got %d", len(c.GetSchemeParts())) |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | func TestParseURI_S3BucketOnly(t *testing.T) { |
| 449 | t.Parallel() |
nothing calls this directly
no test coverage detected