@@ -12,7 +12,6 @@ import (
1212
1313 "github.com/ActiveState/cli/internal/testhelpers/suite"
1414
15- "github.com/ActiveState/cli/internal/config"
1615 "github.com/ActiveState/cli/internal/constants"
1716 "github.com/ActiveState/cli/internal/fileutils"
1817 "github.com/ActiveState/cli/internal/subshell"
@@ -204,8 +203,30 @@ func (suite *DeployIntegrationTestSuite) TestDeployPython() {
204203 cp .SendLine ("python3 -m pytest --version" )
205204 cp .Expect ("pytest" )
206205
206+ if runtime .GOOS != "windows" {
207+ // Test config file
208+ cfg := ts .Config ()
209+
210+ var rcFile string
211+ ts .WithEnv (func () {
212+ subshell := subshell .New (cfg )
213+ rcFile , err = subshell .RcFile ()
214+ suite .Require ().NoError (err )
215+ })
216+
217+ fmt .Println ("RCFile location:" , rcFile )
218+
219+ bashContents := fileutils .ReadFileUnsafe (rcFile )
220+ fmt .Println ("Bash contents:" , string (bashContents ))
221+ } else {
222+ // Test registry
223+ out , err := exec .Command ("reg" , "query" , `HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment` , "/v" , "Path" ).Output ()
224+ suite .Require ().NoError (err )
225+ suite .Contains (string (out ), targetID , "bashrc should contain our target dir" )
226+ }
227+
207228 cp .SendLine ("exit" )
208- cp .ExpectExitCode (0 )
229+ cp .ExpectExitCode (1 )
209230
210231 suite .AssertConfig (ts , targetID .String ())
211232}
@@ -294,17 +315,17 @@ func (suite *DeployIntegrationTestSuite) TestDeployConfigure() {
294315func (suite * DeployIntegrationTestSuite ) AssertConfig (ts * e2e.Session , targetID string ) {
295316 if runtime .GOOS != "windows" {
296317 // Test config file
297- cfg , err := config .New ()
298- suite .Require ().NoError (err )
299318
300- subshell := subshell .New (cfg )
301- rcFile , err := subshell .RcFile ()
302- suite .Require ().NoError (err )
319+ ts .WithEnv (func () {
320+ subshell := subshell .New (ts .Config ())
321+ rcFile , err := subshell .RcFile ()
322+ suite .Require ().NoError (err )
303323
304- bashContents := fileutils .ReadFileUnsafe (rcFile )
305- suite .Contains (string (bashContents ), constants .RCAppendDeployStartLine , "config file should contain our RC Append Start line" )
306- suite .Contains (string (bashContents ), constants .RCAppendDeployStopLine , "config file should contain our RC Append Stop line" )
307- suite .Contains (string (bashContents ), targetID , "config file should contain our target dir" )
324+ bashContents := fileutils .ReadFileUnsafe (rcFile )
325+ suite .Contains (string (bashContents ), constants .RCAppendDeployStartLine , "config file should contain our RC Append Start line" )
326+ suite .Contains (string (bashContents ), constants .RCAppendDeployStopLine , "config file should contain our RC Append Stop line" )
327+ suite .Contains (string (bashContents ), targetID , "config file should contain our target dir" )
328+ })
308329 } else {
309330 // Test registry
310331 out , err := exec .Command ("reg" , "query" , `HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment` , "/v" , "Path" ).Output ()
0 commit comments