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

Function TestJSONProject_User

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

Regression test from before ExportData was implemented.

(t *testing.T)

Source from the content-addressed store, hash-verified

9
10// Regression test from before ExportData was implemented.
11func TestJSONProject_User(t *testing.T) {
12 project := Project{
13 ID: "123",
14 Number: 2,
15 URL: "a url",
16 ShortDescription: "short description",
17 Public: true,
18 Readme: "readme",
19 }
20
21 project.Items.TotalCount = 1
22 project.Fields.TotalCount = 2
23 project.Owner.TypeName = "User"
24 project.Owner.User.Login = "monalisa"
25 b, err := json.Marshal(project.ExportData(nil))
26 assert.NoError(t, err)
27
28 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":"User","login":"monalisa"}}`, string(b))
29}
30
31// Regression test from before ExportData was implemented.
32func TestJSONProject_Org(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ExportDataMethod · 0.95

Tested by

no test coverage detected