Add basic unit test support for session#6
Conversation
…ation bugs
- Fix environment variable type handling in _load_env()
* Convert CONSOLE_LOG_LEVEL and LOGGING_LOG_LEVEL from string to int
* Add proper error handling with fallback defaults
* Resolves TypeError when comparing string env vars to int values
- Fix Privileges object iteration in get_privilege_by_org_id()
* Access privileges.privileges list instead of iterating Privileges object directly
* Use priv.org_id attribute access instead of dict-style priv.get('org_id')
* Return properly formatted dict for backwards compatibility
* Resolves 'TypeError: Privileges object is not iterable'
- Fix double Privileges wrapping in __str__ method
* Check if self.privileges is already a Privileges instance before wrapping
* Prevents TypeError in string representation
- Improve code formatting and consistency per PEP 8
|
@tmunzer consider this draft at the moment for discussion. Valid tests for session, identified a few minor issues, included fixes. Can you check and run and validate fixes don't impact any other behaviour? For discussion:
|
|
Thanks @damianoneill ! Everything should be Ok, except for
I think this may cause an issue in some condition (the --
Yes, didn't took the time for that yet
Agree, I stated to look at that last week, I just want to be sure to not break any use of this tool by partners. Default behavior should stay the current one, but async option should be proposed.
agree |
fix: resolve environment variable type conversion and privileges iteration bugs
Fix environment variable type handling in _load_env()
Fix Privileges object iteration in get_privilege_by_org_id()
Fix double Privileges wrapping in str method
Improve code formatting and consistency per PEP 8