pyramid_swagger
pyramid_swagger copied to clipboard
Convert enable_api_doc_views to bool
Previously, setting pyramid_swagger.enable_api_doc_views = false in a configuration .ini file would not disable the api_doc views, because the string 'false' is truthy.
- Convert the string-value of settings.get('pyramid_swagger.enable_api_doc_views', True) to a bool using pyramid.settings.asbool . (https://docs.pylonsproject.org/projects/pyramid/en/latest/api/settings.html)
Coverage remained the same at ?% when pulling 393c4b08986a843d8f01279e8ffcefbe6260e02e on DaineDanielson:patch-1 into 1dbc0b4f23e2e5f4ed575c116f3f7d0e83e30d45 on striglia:master.
Thanks for the fix Daine! This isn't the first bug we've had loading ini files....do you have any idea how we can effective test ini features? I'd love to write a test module for making sure we properly load from file...
I don't have a thought of how to do this off the top of my head, but it would definitely be great to find a way to test this in general, for any ini-setting, existing or future. I would need to get a broader view of the pyramid_swagger codebase, which I sadly don't have time to do right now. Thanks for being so responsive on this, @striglia!