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

Grossberg code challenge #37

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dwgrossberg
Copy link

@dwgrossberg dwgrossberg commented Jul 15, 2024

Overview

This PR is a solution to the code-challenge problem of recreating the address parsing form in DataMade's Parserator web service.

Demo

data-made-code-challenge

Notes

A slight addition to the Dockerfile was required in order for me to successfully build the application. I needed to install npm using the script: RUN apt-get update && apt-get install -y npm.

Additionally, I encountered a few linting errors while making use of ES6 syntax, however as far as I can tell this did not impact the application's performance.

Testing Instructions

  • Run docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app to test the application
  • test_api_address_resolves_to_view_name ensures that the api endpoint address matches the api view name as expected.
  • test_api_parse_succeeds tests that a valid address string will be correctly parsed by the application. This test checks that the data returned will be in the correct form and that the status_code will be 200.
  • test_api_parse_raises_error tests that an invalid address string will correctly raise a RepeatedLabelError. This test checks that the data returned will contain the correct error information and that the status_code will be 400.
  • test_missing_address_query_term_raises_parse_error checks that a corrupted query_param will result in a ParseError.
  • test_api_parse_empty_string_succeeds verifies that a blank string will return a response status_code of 200.

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.

1 participant