MCPcopy Create free account
hub / github.com/cli/cli / TestJSONProject_Org

Function TestJSONProject_Org

pkg/cmd/project/shared/queries/export_data_test.go:32–50  ·  view source on GitHub ↗

Regression test from before ExportData was implemented.

(t *testing.T)

Source from the content-addressed store, hash-verified

30
31// Regression test from before ExportData was implemented.
32func TestJSONProject_Org(t *testing.T) {
33 project := Project{
34 ID: "123",
35 Number: 2,
36 URL: "a url",
37 ShortDescription: "short description",
38 Public: true,
39 Readme: "readme",
40 }
41
42 project.Items.TotalCount = 1
43 project.Fields.TotalCount = 2
44 project.Owner.TypeName = "Organization"
45 project.Owner.Organization.Login = "github"
46 b, err := json.Marshal(project.ExportData(nil))
47 assert.NoError(t, err)
48
49 assert.JSONEq(t, `{"number":2,"url":"a url","shortDescription":"short description","public":true,"closed":false,"title":"","id":"123","readme":"readme","items":{"totalCount":1},"fields":{"totalCount":2},"owner":{"type":"Organization","login":"github"}}`, string(b))
50}
51
52// Regression test from before ExportData was implemented.
53func TestJSONProjects(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ExportDataMethod · 0.95

Tested by

no test coverage detected