Skip to content
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

Add auth tests #522

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add auth tests #522

wants to merge 3 commits into from

Conversation

hoeg
Copy link
Contributor

@hoeg hoeg commented Jan 19, 2024

Restructured for testability and added some tests for auto login

@hoeg hoeg requested a review from a team as a code owner January 19, 2024 12:10
@hoeg hoeg enabled auto-merge (squash) January 19, 2024 12:10
Copy link
Contributor

@kjuulh kjuulh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits

}

client, err := ua.Access(context.Background())
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend to use require.NoError instead with a msg if wanted.

if err != nil {
t.Fatal(err)
}
if client == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and assert.NotNil etc for the tests below

}
}

type HttpAuth struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you're using a mocking framework?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer this approach then I am fine xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants