Skip to content

Commit

Permalink
Increases test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-debricked committed Dec 5, 2023
1 parent ca1f693 commit db30e57
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/resolution/pm/pip/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ func TestRunInstallCmdBuildErr(t *testing.T) {
assert.Len(t, j.Errors().GetAll(), 1)
}

func TestRunInstallCmdAuthErr(t *testing.T) {
cmdErr := errors.New(
"WARNING: 401 Error, Credentials not correct for <some-pip-registry>\n" +
"No matching distribution found for some-dependency>=0.1.3\n",
)
cmdFactoryMock := testdata.NewEchoCmdFactory()
cmdFactoryMock.MakeInstallErr = cmdErr
fileWriterMock := &writerTestdata.FileWriterMock{}
j := NewJob("file", true, cmdFactoryMock, fileWriterMock, pipCleaner{})

go jobTestdata.WaitStatus(j)
j.Run()

assert.Len(t, j.Errors().GetAll(), 1)
}

func TestRunInstallCmdOutputErr(t *testing.T) {
cmdMock := testdata.NewEchoCmdFactory()
cmdMock.InstallCmdName = badName
Expand Down

0 comments on commit db30e57

Please sign in to comment.