Closed rafiramadhana closed 1 year ago
The test you provided looks promising, It'll be a good starting point to write other tests. I'll try to learn more about utilizing this magic mock
anyway, you can just add the pytest-cov
under dev section here along with the requirements.txt
I explained above
https://github.com/warnet-gi/WarnetBot/blob/01cbd9fdb80b29fd83a495adeafd36bd1869d44a/pyproject.toml#L21-L24
anyway, you can just add the pytest-cov under dev section here along with the requirements.txt I explained above
got it
@Iqrar99 btw do you have concerns for the .env.test?
the reason why I don't use .env.example is because the code expects GUILD_ID
and DEV_GUILD_ID
to be numeric
while they are set as alphabet in the .env.example
GUILD_ID="YOUR_GUILD_ID"
DEV_GUILD_ID="YOUR_DEV_GUILD_ID"
i think, we can also update the .env.example instead of adding .env.test to reduce the number of files within the codebase
---GUILD_ID="YOUR_GUILD_ID"
+++GUILD_ID="123"
---DEV_GUILD_ID="YOUR_DEV_GUILD_ID"
+++DEV_GUILD_ID="123"
wdyt?
PS. in this PR, to avoid breaking in other developer's env (which uses .env.example) i chose to add a new file .env.test instead
i think, we can also update the .env.example instead of adding .env.test to reduce the number of files within the codebase
Have you tried to change the guild id variables in .env.example
to numeric? Does it work with the test? if yes, then it sounds good. Then, we can add a comment suggesting people change the env variables to their own guild id.
Have you tried to change the guild id variables in .env.example to numeric? Does it work with the test?
yes. ok, i will update the .env.example
Relates to https://github.com/warnet-gi/WarnetBot/issues/54
This PR is initiating TDD by:
General
cog.env.test
(it looks like our app does not start if we rely on the.env.example
)Some notes:
General.ping
andGeneral.nobar
pip install pytest-cov
andpip freeze >> requirements.txt
PS. This PR is very open for discussions