Skip to content

Commit 0355d7d

Browse files
authored
Merge pull request #120 from ozontech/fix-attachment-uuid
make attachment uuid public
2 parents d1b61c1 + 638339f commit 0355d7d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/allure/attachment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Attachment struct {
1010
Name string `json:"name,omitempty"` // Attachment name
1111
Source string `json:"source,omitempty"` // Path to the Attachment file (name)
1212
Type MimeType `json:"type,omitempty"` // Mime-type of the Attachment
13-
uuid string // Unique identifier of the Attachment
13+
UUID string `json:"uuid,omitempty"` // Unique identifier of the Attachment
1414
content []byte // Attachment's content as bytes array
1515
}
1616

@@ -102,7 +102,7 @@ func NewAttachment(name string, mimeType MimeType, content []byte) *Attachment {
102102
id := uuid.New().String()
103103

104104
return &Attachment{
105-
uuid: id,
105+
UUID: id,
106106
content: content,
107107
Name: name,
108108
Type: mimeType,
@@ -111,7 +111,7 @@ func NewAttachment(name string, mimeType MimeType, content []byte) *Attachment {
111111
}
112112

113113
func (a *Attachment) GetUUID() string {
114-
return a.uuid
114+
return a.UUID
115115
}
116116

117117
func (a *Attachment) GetContent() []byte {

pkg/allure/attachment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestNewAttachment(t *testing.T) {
3838
t.Run(testAttachName, func(t *testing.T) {
3939
content := []byte("some content")
4040
attachment := NewAttachment(testAttachName, mt, content)
41-
require.NotNil(t, attachment.uuid)
41+
require.NotNil(t, attachment.UUID)
4242
require.Equal(t, mt, attachment.Type, "mime type should be same")
4343
require.Equal(t, testAttachName, attachment.Name)
4444
require.Equal(t, content, attachment.content)

0 commit comments

Comments
 (0)