Skip to content

Commit 2fed925

Browse files
committed
Fix tests
1 parent 9cde32e commit 2fed925

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

pkg/platform/api/reqsimport/reqsimport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type TranslationReqMsg struct {
9999
Data string `json:"requirements"`
100100
Language string `json:"language"`
101101
IncludeLanguageCore bool `json:"includeLanguageCore"`
102-
NamespaceOverride string `json:"namespaceOverride"`
102+
NamespaceOverride string `json:"namespaceOverride,omitempty"`
103103
Filename string `json:"filename"`
104104
Unformatted bool `json:"unformatted"`
105105
}

test/integration/import_int_test.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package integration
22

33
import (
4-
"fmt"
54
"os"
65
"path/filepath"
76
"strings"
@@ -11,7 +10,6 @@ import (
1110
"github.com/ActiveState/termtest"
1211

1312
"github.com/ActiveState/cli/internal/constants"
14-
"github.com/ActiveState/cli/internal/strutils"
1513
"github.com/ActiveState/cli/internal/testhelpers/e2e"
1614
"github.com/ActiveState/cli/internal/testhelpers/osutil"
1715
"github.com/ActiveState/cli/internal/testhelpers/suite"
@@ -87,21 +85,16 @@ func (suite *ImportIntegrationTestSuite) TestImport() {
8785
defer ts.Close()
8886

8987
ts.LoginAsPersistentUser()
90-
pname := strutils.UUID()
91-
namespace := fmt.Sprintf("%s/%s", e2e.PersistentUsername, pname.String())
9288

93-
cp := ts.Spawn("init", "--language", "python", namespace, ts.Dirs.Work)
94-
cp.Expect("successfully initialized", e2e.RuntimeSourcingTimeoutOpt)
95-
cp.ExpectExitCode(0)
96-
ts.NotifyProjectCreated(e2e.PersistentUsername, pname.String())
89+
ts.PrepareProject("ActiveState-CLI/small-python", "5a1e49e5-8ceb-4a09-b605-ed334474855b")
9790

98-
reqsFilePath := filepath.Join(cp.WorkDirectory(), reqsFileName)
91+
reqsFilePath := filepath.Join(ts.Dirs.Work, reqsFileName)
9992

10093
suite.Run("invalid requirements.txt", func() {
10194
ts.SetT(suite.T())
10295
ts.PrepareFile(reqsFilePath, badReqsData)
10396

104-
cp = ts.Spawn("import", "requirements.txt")
97+
cp := ts.Spawn("import", "requirements.txt")
10598
cp.ExpectNotExitCode(0)
10699
})
107100

@@ -137,9 +130,9 @@ func (suite *ImportIntegrationTestSuite) TestImport() {
137130
cp.Expect(">=0.6.1 →")
138131
cp.Expect("Mopidy-Dirble")
139132
cp.Expect("requests")
140-
cp.Expect(">=2.2,<2.31.0 → 2.30.0")
133+
cp.Expect(">=2.2,<2.31.0 → ")
141134
cp.Expect("urllib3")
142-
cp.Expect(">=1.21.1,<=1.26.5 → 1.26.5")
135+
cp.Expect(">=1.21.1,<=1.26.5 → ")
143136
cp.ExpectExitCode(0)
144137
})
145138
ts.IgnoreLogErrors()

0 commit comments

Comments
 (0)