Enable some more bandit checks (#30857)

* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
This commit is contained in:
Ville Skyttä authored and GitHub committed 2020-01-20 18:44:55 +02:00
1 parent 6cf20fc7fa
commit 5e2ba2eb77
21 files changed
+110 -91

No files matched your search

@@ -137,7 +137,7 @@ def test_config_verify_ssl_but_no_ssl_enabled(hass, mock_session_send):
CONF_HOST: "tomato-router",
CONF_PORT: 1234,
CONF_SSL: False,
CONF_VERIFY_SSL: "/tmp/tomato.crt",
CONF_VERIFY_SSL: "/test/tomato.crt",
CONF_USERNAME: "foo",
CONF_PASSWORD: "password",
tomato.CONF_HTTP_ID: "1234567890",
@@ -171,7 +171,7 @@ def test_config_valid_verify_ssl_path(hass, mock_session_send):
CONF_HOST: "tomato-router",
CONF_PORT: 1234,
CONF_SSL: True,
CONF_VERIFY_SSL: "/tmp/tomato.crt",
CONF_VERIFY_SSL: "/test/tomato.crt",
CONF_USERNAME: "bar",
CONF_PASSWORD: "foo",
tomato.CONF_HTTP_ID: "0987654321",
@@ -189,7 +189,7 @@ def test_config_valid_verify_ssl_path(hass, mock_session_send):
assert "exec=devlist" in result.req.body
assert mock_session_send.call_count == 1
assert mock_session_send.mock_calls[0] == mock.call(
result.req, timeout=3, verify="/tmp/tomato.crt"
result.req, timeout=3, verify="/test/tomato.crt"
)