Skip to content

Add auth tests#522

Open
hoeg wants to merge 3 commits intomasterfrom
add-auth-tests
Open

Add auth tests#522
hoeg wants to merge 3 commits intomasterfrom
add-auth-tests

Conversation

@hoeg
Copy link
Copy Markdown
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 January 19, 2024 12:10
@hoeg hoeg enabled auto-merge (squash) January 19, 2024 12:10
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants