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

Function TestSupportsAttachments

pkg/cmd/issue/artifact/shared/shared_test.go:922–960  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

920}
921
922func TestSupportsAttachments(t *testing.T) {
923 tests := []struct {
924 name string
925 artifactType string
926 want bool
927 }{
928 {
929 name: "generic",
930 artifactType: "generic",
931 want: true,
932 },
933 {
934 name: "plan",
935 artifactType: "plan",
936 want: true,
937 },
938 {
939 name: "link",
940 artifactType: "link",
941 want: false,
942 },
943 {
944 name: "embedded_html, since --attach only rewrites Markdown",
945 artifactType: "embedded_html",
946 want: false,
947 },
948 {
949 name: "a type gh doesn't know",
950 artifactType: "bad-type",
951 want: false,
952 },
953 }
954
955 for _, tt := range tests {
956 t.Run(tt.name, func(t *testing.T) {
957 assert.Equal(t, tt.want, SupportsAttachments(tt.artifactType))
958 })
959 }
960}
961
962func TestHTTPURL(t *testing.T) {
963 tests := []struct {

Callers

nothing calls this directly

Calls 3

SupportsAttachmentsFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected