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

[MM-918]: Added testcase for more functions in command.go #847

Open
wants to merge 2 commits into
base: add_api/command.go_testcases
Choose a base branch
from

Conversation

Kshitij-Katiyar
Copy link
Contributor

@Kshitij-Katiyar Kshitij-Katiyar commented Nov 12, 2024

Summary

Added server test cases in command.go for the below function:

  • CreatePost
  • HandleUnsubscribe
  • HandleSettings
  • HandleIssue
  • IsAuthorizedSysAdmin
  • SliceContainsString

Parent PR

#845

@Kshitij-Katiyar Kshitij-Katiyar added the 2: Dev Review Requires review by a core committer label Nov 12, 2024
Copy link
Member

@wiggin77 wiggin77 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

* [MM-946]: Added testcases for some functions in command.go

* [MM-946]: reduced permissions to test os
setup: func() {
mockKvStore.EXPECT().Get(SubscriptionsKey, gomock.Any()).DoAndReturn(func(key string, value **Subscriptions) error {
*value = &Subscriptions{
Repositories: map[string][]*Subscription{
Copy link
Contributor

Choose a reason for hiding this comment

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

Create util if possible as mentioned in previous PR #846 (comment)

}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
tc.setup()
Copy link
Contributor

Choose a reason for hiding this comment

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

Add mockAPI.expectedCall=nil in all the testcases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants