Repository navigation
fix: register custom config model - #189
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #189 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 978 984 +6
=========================================
+ Hits 978 984 +6 ☔ View full report in Codecov by Sentry. |
|
@uniqueg I couldn't figure out on how to add tests for this specific change as it is just reading the model field from the config and converting it to an absolute path. I have tested this by manually passing model from cloud-registry and it is working fine. |
uniqueg
left a comment
There was a problem hiding this comment.
This is a very elegant fix, thanks a lot
uniqueg
left a comment
There was a problem hiding this comment.
I have just seen the comment about the tests. I guess you could simply test it by instantiating the model with None, with a relative path, with an absolute path and with an invalid/non-existing path.
If you can add those tests and they pass, you can just go ahead and merge it. I don't think there will be a need for another review.
If you still have trouble writing the tests, just text in the #foca channel on Slack and I'll help you :)
|
Hey @uniqueg can you please review the PR again, I was not confident if I was adding tests the correct way :) |
Description
This PR fixes the bug where foca did not register a custom config model which is passed in the input config if the api specs were not provided.
In addition, the validator for model path also converts the relative path passed in the config.yaml to the absolute path because casbin is not able to resolve relative path directly.
Fixes #181
Type of change