Skip to content

Move the security cog tests to unittest.#525

Merged
SebastiaanZ merged 3 commits into
unittest-migrationfrom
cogs-security-unittest
Oct 14, 2019
Merged

Move the security cog tests to unittest.#525
SebastiaanZ merged 3 commits into
unittest-migrationfrom
cogs-security-unittest

Conversation

@jchristgit
Copy link
Copy Markdown
Contributor

No description provided.

@jchristgit jchristgit added a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) a: CI Related to continuous intergration and deployment type: tests labels Oct 12, 2019
Comment thread tests/cogs/test_security.py Outdated
Comment on lines +15 to +18
self.bot = MagicMock()
self.cog = security.Security(self.bot)
self.ctx = MagicMock()
self.ctx.author = MagicMock()
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.

There are some mock helpers set-up for Bot and Context in tests.helpers that follow the specifications of the objects they're mocking (using the spec parameter of Mock/MagicMock) and have some commonly used attributes already set up (like the author attribute for the Context mock with a Member mock that follows the discord.Member spec and send for the Context mock with an AsyncMock).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see 612994a

Copy link
Copy Markdown
Contributor Author

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

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

hello no i just wanted to reply to the comment not start a review tyvm

@SebastiaanZ SebastiaanZ merged commit 0dabafc into unittest-migration Oct 14, 2019
@SebastiaanZ SebastiaanZ deleted the cogs-security-unittest branch October 14, 2019 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) a: CI Related to continuous intergration and deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants