Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lpusok committed Oct 25, 2024
1 parent 9725fa9 commit 812da67
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion devportalservice/devportalservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestGetAppleDeveloperConnection(t *testing.T) {
})

t.Run(tt.name+"_file", func(t *testing.T) {
c := NewBitriseClient(logger, NewMockFileReader(tt.responseContent), nil, "file://dummy url", "dummy token")
c := NewBitriseClient(logger, newMockFileReader(tt.responseContent), nil, "file://dummy url", "dummy token")
got, err := c.GetAppleDeveloperConnection()
require.NoError(t, err)
require.Equal(t, tt.want, got)
Expand Down
30 changes: 19 additions & 11 deletions devportalservice/mock_filemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,52 @@ import (
"github.com/bitrise-io/go-utils/v2/fileutil"
)

type MockFileReader struct {
type mockFileReader struct {
contents string
}

func NewMockFileReader(contents string) fileutil.FileManager {
return &MockFileReader{
func newMockFileReader(contents string) fileutil.FileManager {
return &mockFileReader{
contents: contents,
}
}

func (r *MockFileReader) Open(path string) (*os.File, error) {
// Open ...
func (r *mockFileReader) Open(path string) (*os.File, error) {
panic("not implemented")
}

func (r *MockFileReader) OpenReaderIfExists(path string) (io.Reader, error) {
// OpenReaderIfExists ...
func (r *mockFileReader) OpenReaderIfExists(path string) (io.Reader, error) {
return io.NopCloser(strings.NewReader(r.contents)), nil
}

func (r *MockFileReader) ReadDirEntryNames(path string) ([]string, error) {
// ReadDirEntryNames ...
func (r *mockFileReader) ReadDirEntryNames(path string) ([]string, error) {
panic("not implemented")
}

func (r *MockFileReader) Remove(path string) error {
// Remove ...
func (r *mockFileReader) Remove(path string) error {
panic("not implemented")
}

func (r *MockFileReader) RemoveAll(path string) error {
// RemoveAll ...
func (r *mockFileReader) RemoveAll(path string) error {
panic("not implemented")
}

func (r *MockFileReader) Write(path string, value string, perm os.FileMode) error {
// Write ...
func (r *mockFileReader) Write(path string, value string, perm os.FileMode) error {
panic("not implemented")
}

func (r *MockFileReader) WriteBytes(path string, value []byte) error {
// WriteBytes ...
func (r *mockFileReader) WriteBytes(path string, value []byte) error {
panic("not implemented")
}

func (r *MockFileReader) FileSizeInBytes(pth string) (int64, error) {
// FileSizeInBytes ...
func (r *mockFileReader) FileSizeInBytes(pth string) (int64, error) {
panic("not implemented")
}

0 comments on commit 812da67

Please sign in to comment.