Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 29, 2024
1 parent 2b0e736 commit 4d1a0a1
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 33 deletions.
12 changes: 6 additions & 6 deletions airflow/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

type Suite struct {
suite.Suite
origCmdExec func(cmd string, stdout, stderr io.Writer, args ...string) error
origGetDockerClient func() (client.APIClient, error)
origCmdExec func(cmd string, stdout, stderr io.Writer, args ...string) error
origGetDockerClient func() (client.APIClient, error)
}

var _ suite.SetupAllSuite = (*Suite)(nil)
Expand All @@ -22,11 +22,11 @@ func TestAirflow(t *testing.T) {
}

func (s *Suite) SetupSuite() {
s.origCmdExec = cmdExec
s.origGetDockerClient = getDockerClient
s.origCmdExec = cmdExec
s.origGetDockerClient = getDockerClient
}

func (s *Suite) TearDownTest() {
cmdExec = s.origCmdExec
getDockerClient = s.origGetDockerClient
cmdExec = s.origCmdExec
getDockerClient = s.origGetDockerClient
}
3 changes: 1 addition & 2 deletions cloud/deployment/fromfile/fromfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ var (
}
)


type Suite struct {
suite.Suite
}
Expand All @@ -320,7 +319,7 @@ func TestFromFile(t *testing.T) {
}

func (s *Suite) SetupTest() {
testUtil.InitTestConfig(testUtil.CloudPlatform)
testUtil.InitTestConfig(testUtil.CloudPlatform)
}

var _ suite.SetupTestSuite = (*Suite)(nil)
Expand Down
6 changes: 3 additions & 3 deletions cmd/airflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ func (s *AirflowSuite) SetupTest() {

func (s *AirflowSuite) TearDownTest() {
// Clean up init files after test
s.cleanUpInitFiles()
s.cleanUpInitFiles()
}

func (s *AirflowSuite) TearDownSubTest() {
// Clean up init files after test
s.cleanUpInitFiles()
s.cleanUpInitFiles()
}

var _ suite.SetupTestSuite = (*AirflowSuite)(nil)
Expand Down Expand Up @@ -180,7 +180,7 @@ func (s *AirflowSuite) Test_airflowInitNoDefaultImageTag() {
}

func (s *AirflowSuite) cleanUpInitFiles() {
s.T().Helper()
s.T().Helper()
files := []string{
".dockerignore",
".gitignore",
Expand Down
1 change: 0 additions & 1 deletion cmd/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/spf13/cobra"
)


func (s *CmdSuite) TestAuthRootCommand() {
testUtil.InitTestConfig(testUtil.LocalPlatform)
output, err := executeCommand("login", "--help")
Expand Down
1 change: 0 additions & 1 deletion cmd/registry/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/suite"
)


type Suite struct {
suite.Suite
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/software/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ func NewDeployCmd() *cobra.Command {
cmd.Flags().BoolVarP(&ignoreCacheDeploy, "no-cache", "", false, "Do not use cache when building container image")
cmd.Flags().StringVar(&workspaceID, "workspace-id", "", "workspace assigned to deployment")


if !context.IsCloudContext() && houston.VerifyVersionMatch(houstonVersion, houston.VersionRestrictions{GTE: "0.34.0"}) {
cmd.Flags().BoolVarP(&isDagOnlyDeploy, "dags", "d", false, "Push only DAGs to your Deployment")
}
}
return cmd
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/software/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func TestAddCmds(t *testing.T) {
}

func (s *AddCmdSuite) TearDownSuite() {
// Reset the version once this is torn down
houstonVersion = "0.34.0"
// Reset the version once this is torn down
houstonVersion = "0.34.0"
}

func (s *AddCmdSuite) SetupSuite() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/software/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (s *Suite) SetupSuite() {
}

func (s *Suite) SetupTest() {
// Reset the version once this is torn down
houstonVersion = "0.34.0"
// Reset the version once this is torn down
houstonVersion = "0.34.0"
}

var _ suite.SetupAllSuite = (*Suite)(nil)
Expand Down
1 change: 0 additions & 1 deletion pkg/azure/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

var errMock = errors.New("test error")


type Suite struct {
suite.Suite
}
Expand Down
1 change: 1 addition & 0 deletions pkg/domainutil/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
"pr12346",
}
)

type Suite struct {
suite.Suite
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/fileutil/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ func (s *Suite) TestWriteStringToFile() {
if tt.errAssertion(s.T(), WriteStringToFile(tt.args.path, tt.args.s)) {
return
}
_, err := os.Open(tt.args.path)
s.NoError(err, "Error opening file %s", tt.args.path)
_, err := os.Open(tt.args.path)
s.NoError(err, "Error opening file %s", tt.args.path)
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/input/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (s *Suite) TestText() {
stdin := os.Stdin
os.Stdin = r

s.Equal(tt.want, Text(tt.args.promptText))
s.Equal(tt.want, Text(tt.args.promptText))

// Restore stdin right after the test.
os.Stdin = stdin
Expand Down Expand Up @@ -106,7 +106,7 @@ func (s *Suite) TestConfirm() {
return
}

s.Equal(tt.want, got)
s.Equal(tt.want, got)

// Restore stdin right after the test.
os.Stdin = stdin
Expand Down Expand Up @@ -150,7 +150,7 @@ func (s *Suite) TestPassword() {
return
}

s.Equal(tt.want, got)
s.Equal(tt.want, got)

// Restore stdin right after the test.
os.Stdin = stdin
Expand Down Expand Up @@ -194,7 +194,7 @@ func (s *Suite) TestPromptGetConfirmation() {
return
}

s.Equal(tt.want, got)
s.Equal(tt.want, got)
})
}
}
4 changes: 2 additions & 2 deletions pkg/printutil/printutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (s *Suite) TestGetPadding() {
}
for _, tt := range tests {
s.Run(tt.name, func() {
s.Equal(tt.want, getPadding(tt.args.padding))
s.Equal(tt.want, getPadding(tt.args.padding))
})
}
}
Expand All @@ -294,7 +294,7 @@ func (s *Suite) TestStrSliceToInterSlice() {
}
for _, tt := range tests {
s.Run(tt.name, func() {
s.Equal(tt.want, strSliceToInterSlice(tt.args.ss))
s.Equal(tt.want, strSliceToInterSlice(tt.args.ss))
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func StringContains(tt []string, t string) bool {
func MockUserInput(t *testing.T, i string) func() {
input := []byte(i)
r, w, err := os.Pipe()
require.NoError(t, err)
require.NoError(t, err)
_, err = w.Write(input)
if err != nil {
t.Error(err)
Expand Down
3 changes: 1 addition & 2 deletions pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func TestUtils(t *testing.T) {
suite.Run(t, new(Suite))
}


func (s *Suite) TestCoerce() {
type args struct {
version string
Expand Down Expand Up @@ -153,7 +152,7 @@ func (s *Suite) TestExists() {
return
}

s.Equal(tt.want, got)
s.Equal(tt.want, got)
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions settings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func TestSettings(t *testing.T) {

var _ suite.TearDownTestSuite = (*Suite)(nil)

func (s* Suite) TearDownTest() {
settings = Config{}
func (s *Suite) TearDownTest() {
settings = Config{}
}

func (s *Suite) TestConfigSettings() {
Expand Down

0 comments on commit 4d1a0a1

Please sign in to comment.