-
Notifications
You must be signed in to change notification settings - Fork 3
Implement snomed usage data #101
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
Conversation
CarolineMorton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @em-baggie
Thanks for getting this done. This is really fantastic. Well done.
Sorry for the delay in review.
I am going to approve this but if you could add a couple of docs mentioned above this would be great. thanks.
| async fn test_download_usage_from_url() -> Result<(), CodeListBuilderError> { | ||
| let mock_server = MockServer::start().await; | ||
| let usage_year = UsageYear::Y2020_21; | ||
|
|
||
| let test_data = LONG_TEST_DATA; | ||
|
|
||
| Mock::given(method("GET")) | ||
| .and(path(usage_year.path())) | ||
| .respond_with(ResponseTemplate::new(200).set_body_string(test_data)) | ||
| .mount(&mock_server) | ||
| .await; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool to see. I hadn't come across this crate before.
That being said I am not sure we really need to test the functionality of what is essentially a reqwest call. It might be better to concentrate on calls that fail and if the error message that gets passed back is understandable. has the url changed? is the file corrupted? is it too big to be downloaded? etc.
for now, lets keep this test in as it is useful documentation anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll add in a test that mocks the server to return an error code and make sure the custom error picks this up and displays this in a useful way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds like a great use of this crate.
|
I've improved the docs and error handling, so will merge this now. |
Closes #99
See #102