davidhuser / dhis2.py

Generic and lightweight Python wrapper for the DHIS2 API using requests
MIT License
15 stars 12 forks source link

Remove assertion in loading of dish file #28

Open davidhuser opened 3 years ago

davidhuser commented 3 years ago

minor bug: Remove assertion statement:

... used assert to enforce interface constraints. However, assert is removed with compiling to optimised byte code (python -o producing *.pyo files). This caused various protections to be removed.

Test results:
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   Location: dhis2.py/dhis2/api.py:176
   More Info: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
175             password = section["password"]
176             assert all([baseurl, username, password])
177         except (KeyError, AssertionError):