-
Notifications
You must be signed in to change notification settings - Fork 69
Initialize console if -U is specified #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a2b500c
8834ae9
73fc6e1
d9d6821
99140d4
444287d
9eeac74
1837590
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,7 +171,7 @@ func TestConnectCommand(t *testing.T) { | |
err := connectCommand(s, []string{"someserver -U someuser"}, 1) | ||
assert.NoError(t, err, "connectCommand with valid arguments doesn't return an error on connect failure") | ||
assert.True(t, prompted, "connectCommand with user name and no password should prompt for password") | ||
assert.NotEqual(t, "someserver", s.Connect.ServerName, "On error, sqlCmd.Connect does not copy inputs") | ||
assert.NotEqual(t, "someserver", s.Connect.ServerName, "On connection failure, sqlCmd.Connect does not copy inputs") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this changing? s.Connect.ServerName being changed implies that the connection attempt succeeded when it should have failed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding the context. This was a side effect of changing type of connect from ConnectSettings to a pointer to ConnectSettings in sqlcmd struct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the message in the assert didn't provide sufficient context, please update the assert message to be clearer. |
||
err = connectCommand(s, []string{}, 2) | ||
assert.EqualError(t, err, InvalidCommandError("CONNECT", 2).Error(), ":Connect with no arguments should return an error") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this assert is odd. Shouldn't you assert that if RequiresPassword is true then Password == ""?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This was to avoid the conditional check and to assert the same condition for password prompt that we use in connectDb()