Skip to content
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

Add unit test for AI VPN CLI: aivpn.py #52

Open
Adity20 opened this issue Mar 19, 2024 · 0 comments · May be fixed by #59
Open

Add unit test for AI VPN CLI: aivpn.py #52

Adity20 opened this issue Mar 19, 2024 · 0 comments · May be fixed by #59
Labels
enhancement New feature or request
Milestone

Comments

@Adity20
Copy link
Contributor

Adity20 commented Mar 19, 2024

Is your feature request related to a problem? Please describe.
Currently, the AI VPN CLI script lacks unit tests covering functions that interact with a Redis database. To ensure robust testing without relying on an actual Redis connection, it would be beneficial to introduce mock objects for simulating Redis interactions.

Describe the solution you'd like
1.Introducing unit tests for functions interacting with Redis, such as manage_info, manage_expire for now.
2.Using mocking libraries like unittest.mock to create mock Redis client objects in the test environment.
3.Patching relevant functions within the tests to replace actual Redis calls with mock behavior.
4.Verifying the behavior of these functions by adding assertions to check if the expected actions are performed.

Expected Outcome
Improved test coverage for Redis interactions in the AI VPN CLI script.
Reduced dependency on an actual Redis connection during testing, leading to faster and more reliable test execution.

@Adity20 Adity20 linked a pull request Mar 27, 2024 that will close this issue
1 task
@verovaleros verovaleros changed the title Adding a unit test Add unit test for AI VPN CLI: aivpn.py Mar 27, 2024
@verovaleros verovaleros added the enhancement New feature or request label Mar 27, 2024
@verovaleros verovaleros added this to the v0.1.3-beta milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants