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

Function getTablesCommand

cli/cmd/tables_test.go:15–33  ·  view source on GitHub ↗
(t *testing.T, config string, format, filter string)

Source from the content-addressed store, hash-verified

13)
14
15func getTablesCommand(t *testing.T, config string, format, filter string) (*cobra.Command, string) {
16 t.Helper()
17
18 _, filename, _, _ := runtime.Caller(0)
19 currentDir := path.Dir(filename)
20 testConfig := path.Join(currentDir, "testdata", config)
21 tmpDir := t.TempDir()
22 outputDirectory := path.Join(tmpDir, "cq-docs")
23 cmd := NewCmdRoot()
24 args := []string{"tables", testConfig, "--output-dir", outputDirectory}
25 if format != "" {
26 args = append(args, "--format", format)
27 }
28 if filter != "" {
29 args = append(args, "--filter", filter)
30 }
31 cmd.SetArgs(append(args, testCommandArgs(t)...))
32 return cmd, tmpDir
33}
34
35func TestTables(t *testing.T) {
36 configs := []struct {

Callers 2

TestTablesFunction · 0.85
TestTablesWithFilterFunction · 0.85

Calls 2

testCommandArgsFunction · 0.85
NewCmdRootFunction · 0.70

Tested by

no test coverage detected