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

pinning tests #84

Closed snapcat closed 2 years ago

snapcat commented 2 years ago

Summary

This PR increases code coverage for the original pinning.py prior to any additions made by group 25.

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

Resolves #69

Bugs, Notes

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

Codecov Report

Merging #84 (804ca23) into main (e6125fb) will increase coverage by 1.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   85.93%   86.97%   +1.03%     
==========================================
  Files          12       12              
  Lines        1507     1535      +28     
==========================================
+ Hits         1295     1335      +40     
+ Misses        212      200      -12     
Impacted Files Coverage Δ
test/test_bot.py 100.00% <100.00%> (ø)
cogs/pinning.py 83.07% <0.00%> (+18.46%) :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 e6125fb...804ca23. Read the comment docs.