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

Function TestTables

cli/cmd/tables_test.go:35–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestTables(t *testing.T) {
36 configs := []struct {
37 name string
38 config string
39 format string
40 }{
41 {
42 name: "should generate tables in default format",
43 config: "multiple-sources.yml",
44 },
45 {
46 name: "should generate tables in json format",
47 config: "multiple-sources.yml",
48 format: "json",
49 },
50 {
51 name: "should generate tables in markdown format",
52 config: "multiple-sources.yml",
53 format: "markdown",
54 },
55 }
56
57 for _, tc := range configs {
58 t.Run(tc.name, func(t *testing.T) {
59 cmd, docsDir := getTablesCommand(t, tc.config, tc.format, "")
60 commandError := cmd.Execute()
61 require.NoError(t, commandError)
62
63 if tc.format == "markdown" {
64 require.FileExists(t, path.Join(docsDir, "cq-docs/test/README.md"))
65 } else {
66 require.FileExists(t, path.Join(docsDir, "cq-docs/test/__tables.json"))
67 }
68 })
69 }
70}
71
72func TestTablesWithFilter(t *testing.T) {
73 configs := []struct {

Callers

nothing calls this directly

Calls 2

getTablesCommandFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected