-
Notifications
You must be signed in to change notification settings - Fork 179
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
Issue/662 Add API coverage for LTI resource links #673
Issue/662 Add API coverage for LTI resource links #673
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I tested out the 2 get methods and they both work fine!
I tested the create method without the custom hash and it also works. It looks like there's no test case for including custom
.
Custom being incorrect does return this error
UnprocessableEntity: {"errors":[{"code":"invalid_custom","message":"'custom' param must contain key/value pairs"}]}
which all looks good. I tested with {"message": "Hello World"}
and it works as expected.
It looks like Canvas added 3 more API's to this since the ticket was filed for Bulk Create, Update and Delete. It's fine if you don't have time to get to those and I'd take this as-is but we should get an issue filed to capture those additional tasks.
@jonespm Thank you for the comments and for testing them out! Just fixed the import issue in my last commit, so hopefully the PR workflows should pass this time pending your next approval. I'll see to merging this PR first but I'll also create a new issue for the 3 additional endpoints and link this thread to that post for reference. Not sure how much time I'll have this weekend to get to them but I'll definitely take a stab at it! Edit: New issue for additional endpoints linked here |
@jonespm Trying to debug this module import error but having some trouble locating where it's coming from. When I run |
Hmm, I'm not sure, checking this out |
Okay, I think the fix you suggested (removing the imports from in the function and moving it to the top) is needed and will likely get it to pass on Github Actions. There's appears to be a bug in the test scripts/find_missing_modules.py where it won't run correctly if you have canvasapi installed globally or in a venv. I don't think it's installed on the Github process which makes me think it will pass there. I can submit a new issue for a future fix for this if it does pass. I'd filed #675
|
Specifically I think the test (find_missing_modules.py) needs to insert rather than append. But it will only be a problem if other canvasapi's are in the path as well. I can file a issue for this.
|
@jonespm Just pushed the fix you mentioned consolidating the imports to the top. Fingers crossed this works 🤞 |
Okay, well that one does pass now. 3 more alphabetical order issues.
Guess these function names need to be in order too. It did seem to be nice to have them together but I guess that's not the expectation. |
@jonespm Reordered them! I ran |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #673 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 73 74 +1
Lines 3740 3761 +21
=========================================
+ Hits 3740 3761 +21 ☔ View full report in Codecov by Sentry. |
@jonespm My bad, I forgot to run |
It looks like checking import sorting is separate from checking if module names are alphabetical. I'd say that's probably fine but the ordering of the checks should probably be moved around to keep the alphabetical checks together. Looks like all the tests pass now except codecov. Looks like a few cases aren't covered by tests. |
@jonespm Just pushed, sorry took a little longer than expected digging through other files to reference. Hopefully this works! |
@jonespm Damn.. I'm so sorry for the spam. Triple checked |
Looks like all tests have passed! 🎉 It also looks like for first time contributors Github requires each run to be approved. I'm fine merging but going to wait to see if @Thetwam has any comments or wants to click the button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution - looks good! Just have a few minor tweaks for docs. Also need to add to the changelog and add you to authors.
I'll take care of these for ya and get this merged in. Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
Proposed Changes
get_lti_resource_links()
,get_lti_resource_link()
,create_lti_resouce_link()
test_courses.py
,lti_resource_link.json
)Fixes #662
Effects
Note: Local testing proved difficult as I do not have access to a paid Canvas instance where I can generate dummy LTI resource links to view actual server responses (referencing here and here). Resorted to using mock responses to test, but should revisit with access to a paid Canvas account.