pyramid_swagger icon indicating copy to clipboard operation
pyramid_swagger copied to clipboard

Convert enable_api_doc_views to bool

Open DaineDanielson opened this issue 7 years ago • 3 comments

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)

DaineDanielson avatar Sep 24 '17 04:09 DaineDanielson

Coverage Status

Coverage remained the same at ?% when pulling 393c4b08986a843d8f01279e8ffcefbe6260e02e on DaineDanielson:patch-1 into 1dbc0b4f23e2e5f4ed575c116f3f7d0e83e30d45 on striglia:master.

coveralls avatar Sep 24 '17 04:09 coveralls

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...

striglia avatar Sep 27 '17 23:09 striglia

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!

DaineDanielson avatar Oct 31 '17 03:10 DaineDanielson