NOAA-OWP / t-route

Tree based hydrologic and hydraulic routing
Other
40 stars 45 forks source link

Add tests for `troute.config.FilePath` and `troute.config.DirectoryPath` #778

Closed aaraney closed 3 weeks ago

aaraney commented 3 weeks ago

FilePath and DirectoryPath build on pydantic's FilePath and DirectoryPath classes. Specifically, troute.config's version of these classes unable using a "strict" mode (see committed tests for usage). The idea of strict mode is that in some contexts it is desirable to verify if a file or directory path exists. Likewise, in other contexts that is not desirable. "strict" mode enables the best of both worlds by effectively toggling if existence is verified.

To run the tests (assuming you've cloned the repo and you are in the repo root):

pip install 'src/troute-config[test]'
pytest src/troute-config