test: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logic by dlunaaa · Pull Request #845 · twilio/twilio-python

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

Dina Samatova 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.

@dlunaaa dlunaaa changed the title Added test for Video Room, resolved conflict of duplicated names, enhanced code of 'time' logic test: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logic

Feb 25, 2025