test: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logic#845
Open
dlunaaa wants to merge 5 commits intotwilio:mainfrom
Open
test: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logic#845dlunaaa wants to merge 5 commits intotwilio:mainfrom
dlunaaa wants to merge 5 commits intotwilio:mainfrom
Conversation
added 2 commits
February 25, 2025 10:47
…aming conflict, and add Twilio Video Room test - Improved JWT expiration logic: - Replaced time.time() with datetime.datetime.utcnow() to ensure more accurate expiration handling. - Applied datetime.timedelta(seconds=...) for better timestamp calculations. - Ensured compatibility with jwt.encode() by converting expiration times using .timestamp(). - Resolved naming issue between ALGORITHM and algorithm: - Renamed the algorithm parameter to jwt_algorithm to avoid conflicts with the ALGORITHM constant. - Updated all references to maintain consistency throughout the class. - Added unit test for Twilio Video Room creation: - Integrated unittest framework for structured testing. - Used responses library to mock Twilio API calls. - Implemented a test case that validates room creation by checking sid, unique_name, and status. These updates improve JWT handling, fix potential naming conflicts, and introduce automated testing for Twilio API interactions.
Contributor
|
Hi @dlunaaa! Thanks for raising this PR. The files inside rest folder are autogenerated. To add tests for that, please use cluster test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(jwt): Improve JWT expiration handling and fix naming conflicts
time.time()withdatetime.datetime.utcnow()to ensure accurate expiration handling.datetime.timedelta(seconds=...)for better timestamp calculations.jwt.encode()by converting expiration times using.timestamp().algorithmtojwt_algorithmto avoid conflicts with theALGORITHMconstant and ensure consistency.test(twilio): Add unit test for Twilio Video Room creation
unittestframework for structured testing.responseslibrary to mock Twilio API calls.sid,unique_name, andstatus.These changes enhance JWT handling, resolve potential naming conflicts, and introduce automated testing for Twilio API interactions.
Fixes #777
Summary of Changes
This PR addresses the following improvements:
Fix for Issue Code Enhancement #777 (JWT Expiration Handling):
time.time()withdatetime.datetime.utcnow()to ensure accurate expiration calculations.datetime.timedelta(seconds=...)to improve timestamp consistency.jwt.encode()by converting expiration times using.timestamp().Resolved SonarCloud issue (Naming Conflict with ALGORITHM):
algorithmparameter tojwt_algorithmto prevent confusion with theALGORITHMconstant.Added a new unit test for Twilio Video Room creation:
unittestframework for structured testing.responseslibrary.sid,unique_name, andstatus.Checklist
.mdfile (not required).If you have questions, please file a support ticket, or create a GitHub Issue in this repository.