Skip to content

Added test for check of data availability and fixed some checks for _recipe.py#455

Merged
bouweandela merged 8 commits intomasterfrom
files_not_found_error_tests
Feb 12, 2020
Merged

Added test for check of data availability and fixed some checks for _recipe.py#455
bouweandela merged 8 commits intomasterfrom
files_not_found_error_tests

Conversation

@schlunma
Copy link
Contributor

@schlunma schlunma commented Feb 3, 2020

This adds missing tests for #98 (where @valeriupredoi was too quick in merging 😉).

I also fixed some syntactic errors in the tests for _recipe.py which prevented them to work correctly (e.g. this explains why a test didn't fail after #432 even though it should have failed). This revealed some errors in the old tests. I couldn't fix two of them since I'm not quite sure how. Can you have a look at them, @bouweandela please? I think you wrote them (test_extract_shape_raises in tests.integration.test_recipe).

This PR only affects tests, so I think we can quickly merge it.

@schlunma schlunma added the enhancement New feature or request label Feb 3, 2020
@schlunma schlunma self-assigned this Feb 3, 2020
@valeriupredoi
Copy link
Contributor

In principle approved, but then I saw the failed tests (not the ones fixed by #452 ) - can you check them out pls 🍺

@schlunma
Copy link
Contributor Author

schlunma commented Feb 4, 2020

In principle approved, but then I saw the failed tests (not the ones fixed by #452 ) - can you check them out pls beer

These are the ones where @bouweandela needs to step in since I'm not sure about them (I don't know if the test itself is wrong or the function).

@valeriupredoi
Copy link
Contributor

Right on, Ill have a closer look too, after coffee ☕

@valeriupredoi
Copy link
Contributor

that test is badly written in master and you have actually uncovered the badness - the recipe fails with RecipeError(In preprocessor function extract_shape: Unable to find 'shapefile: ') at all times irrespective of the functional argument passed - so it should fail exactly 3 times as you see it fail

@valeriupredoi
Copy link
Contributor

ie if the extract_shape is run without shapefile: test.shp it'll always fail first coz the shapefile is not found due to extract_shape(settings) from _recipe_checks.py - @bouweandela or @JaroCamphuijsen please fix this catch22 🍺

@valeriupredoi
Copy link
Contributor

ie if the extract_shape is run without shapefile: test.shp it'll always fail first coz the shapefile is not found due to extract_shape(settings) from _recipe_checks.py - @bouweandela or @JaroCamphuijsen please fix this catch22 beer

any chance @bouweandela or @JaroCamphuijsen had a look at this pls 🍺

@bouweandela
Copy link
Member

The goal of the check function is to check that the arguments are within valid range and the goal of the test is to check that an RecipeError is raised if an invalid argument is provided. We should probably use a schema for this kind of checking at some point though.

@valeriupredoi
Copy link
Contributor

Ah biutiful, cheers monsieur @bouweandela 🍺

@bouweandela bouweandela merged commit 6c83df1 into master Feb 12, 2020
@bouweandela bouweandela deleted the files_not_found_error_tests branch February 12, 2020 10:28
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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants