CSC510-Group-25 / ClassMateBot

This project helps to improve the life of students, TAs and teachers by automating many mundane tasks which are sometimes done manually on Discord. This is release version 3 of the ClassMateBot.
MIT License
0 stars 5 forks source link

(SEE RENAMED BRANCH) #81

Closed snapcat closed 2 years ago

snapcat commented 2 years ago

Summary

~This PR will marked as ready for review when coverage for pinning.py is at least 75%.~ Coverage for pinning.py is at 93%!

Added tests for pinning.py in test_bot.py

Changed Files

test_bot.py

Renamed def test_pinError as test_pinningErrors

New functions:

* test_pinnedmessages
* test_updatepin

New tests:

test_updatepin:
* Updating a non-existent pin

test_pinnedmessages:
* Getting pins by tag
* Getting pins by tag without any pinned messages
* Getting all pins

test_pinningErrors:
* Unpinning without a message
* Updating a pin with invalid input

Changes to existing tests:

* Moved "Tests adding another message to update pins" from test_pinning() to test_updatepin()
* "Tests pinning without a message" in test_pinningErrors() now uses"with" stmt instead of try-except

Checklist

I tested my tests locally!


Closing Issues

Bugs, Notes

#### Contributors @snapcat
codecov-commenter commented 2 years ago

Codecov Report

Merging #81 (777066c) into main (0cc4feb) will increase coverage by 2.94%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   72.97%   75.92%   +2.94%     
==========================================
  Files          11       11              
  Lines         729      756      +27     
==========================================
+ Hits          532      574      +42     
+ Misses        197      182      -15     
Impacted Files Coverage Δ
test/test_bot.py 98.96% <100.00%> (+0.77%) :arrow_up:
cogs/pinning.py 93.44% <0.00%> (+22.95%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0cc4feb...777066c. Read the comment docs.