Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logic#845

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dlunaaa wants to merge5 commits intotwilio:main
base:main
Choose a base branch
Loading
fromdlunaaa:main

Conversation

dlunaaa
Copy link

@dlunaaadlunaaa commentedFeb 25, 2025
edited
Loading

feat(jwt): Improve JWT expiration handling and fix naming conflicts

  • Replacedtime.time() withdatetime.datetime.utcnow() to ensure accurate expiration handling.
  • Useddatetime.timedelta(seconds=...) for better timestamp calculations.
  • Ensured compatibility withjwt.encode() by converting expiration times using.timestamp().
  • Renamedalgorithm tojwt_algorithm to avoid conflicts with theALGORITHM constant and ensure consistency.

test(twilio): Add unit test for Twilio Video Room creation

  • Integratedunittest framework for structured testing.
  • Usedresponses library to mock Twilio API calls.
  • Implemented a test case that validates room creation by checkingsid,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 IssueCode Enhancement #777 (JWT Expiration Handling):

    • Replacedtime.time() withdatetime.datetime.utcnow() to ensure accurate expiration calculations.
    • Applieddatetime.timedelta(seconds=...) to improve timestamp consistency.
    • Ensured compatibility withjwt.encode() by converting expiration times using.timestamp().
    • These changes improve time handling accuracy, ensuring JWTs expire correctly across different time zones.
  • Resolved SonarCloud issue (Naming Conflict with ALGORITHM):

    • Renamedalgorithm parameter tojwt_algorithm to prevent confusion with theALGORITHM constant.
    • This improves maintainability by avoiding case-sensitive conflicts in variable names.
  • Added a new unit test for Twilio Video Room creation:

    • Integratedunittest framework for structured testing.
    • Mocked Twilio API calls using theresponses library.
    • Verified room creation by checkingsid,unique_name, andstatus.
    • Note: Existing tests already cover the JWT expiration fix, so no additional tests were needed for that.

Checklist

  • I acknowledge that all my contributions will be made under the project's license.
  • I have made a material change to the repo (functionality, testing, spelling, grammar).
  • I have read theContribution Guidelines and my PR follows them.
  • I have titled the PR appropriately.
  • I have updated my branch with the main branch.
  • I have added inline documentation to the code I modified.
  • I have added tests that prove my fix is effective or that my feature works (not required, as existing tests already cover the fix).
  • I have added the necessary documentation about the functionality in the appropriate.md file (not required).

If you have questions, please file asupport ticket, or create a GitHub Issue in this repository.

Dina Samatova added2 commitsFebruary 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.
@dlunaaadlunaaa changed the titleAdded test for Video Room, resolved conflict of duplicated names, enhanced code of 'time' logictest: added test for Video Room, fix: resolved conflict of duplicated names, enhanced code of 'time' logicFeb 25, 2025
@tiwarishubham635
Copy link
Contributor

Hi@dlunaaa! Thanks for raising this PR. The files inside rest folder are autogenerated. To add tests for that, please use cluster test.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Code Enhancement
3 participants
@dlunaaa@tiwarishubham635@manisha1997

[8]ページ先頭

©2009-2025 Movatter.jp