MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / TestBackendOptionsPluginName

Function TestBackendOptionsPluginName

cli/internal/specs/v0/source_test.go:648–685  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

646}
647
648func TestBackendOptionsPluginName(t *testing.T) {
649 tests := []struct {
650 name string
651 options *BackendOptions
652 expected string
653 }{
654 {
655 name: "nil doesn't blow up",
656 options: nil,
657 expected: "",
658 },
659 {
660 name: "No interpolation results in empty plugin name",
661 options: &BackendOptions{
662 TableName: "test_table",
663 Connection: "localhost:7777",
664 },
665 expected: "",
666 },
667 {
668 name: "Proper variable name results in correct plugin name",
669 options: &BackendOptions{
670 TableName: "test_table",
671 Connection: "@@plugins.aws.connection",
672 },
673 expected: "aws",
674 },
675 }
676
677 for _, tt := range tests {
678 t.Run(tt.name, func(t *testing.T) {
679 actual := tt.options.PluginName()
680 if actual != tt.expected {
681 t.Errorf("unexpected plugin name, got: %s, want: %s", actual, tt.expected)
682 }
683 })
684 }
685}

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
PluginNameMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected