You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor & Test: Enhance JWT expiration handling, resolve algorithm naming 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.
0 commit comments