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

Factor out ensure_starts_with_slash() as a separate util function #2640

Merged
merged 3 commits into from Sep 21, 2021

Conversation

convoliution
Copy link
Contributor

@convoliution convoliution commented Sep 16, 2021

Impact and Context

This small behavior of "ensure an endpoint path begins with a slash" is going to be used for our Docker image model support, so this PR factors it out to a reusable utility function.

Risks

This could introduce bugs, but I think there's ample test coverage to rule it out.

Testing

  • Deployed the service to dev env
    • no new service
  • Used functionality on dev env
    • no new backend integration behavior
  • Added unit test(s)
  • Added integration test(s)
pytest test_utils/test_arg_handler.py test_endpoint/test_endpoint.py::TestEndpoint::test_path_ensure_starts_with_slash

passes on my machine in both Python 2.7 and 3.7.

How to Revert

Revert this PR.

@convoliution convoliution changed the title Factor out prepend_slash() as a separate util function Factor out ensure_starts_with_slash() as a separate util function Sep 21, 2021
@convoliution convoliution merged commit 8248b0e into master Sep 21, 2021
@convoliution convoliution deleted the ml/prepend-slash branch September 21, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants