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 a basic mock to handle the requests to the server #282

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

Nicogp
Copy link
Member

@Nicogp Nicogp commented Nov 7, 2024

Related issue
#256

Description

This PR adds a mock of the server, which supports both HTTP and HTTPS protocols. The mock server provides predefined responses to specific API endpoints, including JWT token generation for authentication, file serving, and custom JSON responses. This setup is useful for local testing and simulating interactions with various API endpoints.

@Nicogp Nicogp force-pushed the test/256-add-agent-information branch 3 times, most recently from c75e0b6 to fad9958 Compare November 7, 2024 21:56
@Nicogp Nicogp force-pushed the test/256-add-agent-information branch from fad9958 to 8b88e71 Compare November 7, 2024 22:01
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 86 to 89
#response = self._load_response("events_stateful.json")
self._set_headers(code=200) # If an response is given, add the size of the response.
elif self.path == "/api/v1/events/stateless":
#response = self._load_response("events_stateless.json")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented out code necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these endpoints publish information, for the moment it only returns code=200, in case a response is included this line must be uncommented.

Copy link
Contributor

@aritosteles aritosteles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…sent response. Predefined responses were moved to a template file.
@TomasTurina TomasTurina merged commit 6657451 into master Nov 8, 2024
5 checks passed
@TomasTurina TomasTurina deleted the test/256-add-agent-information branch November 8, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants