def test_auth_ok(): with patch( "salt.utils.http.query", MagicMock(return_value={ "status": 200, "dict": ["@wheel"] }), ): ret = rest.auth("foo", None) assert ret is True
def test_auth_nouser(): ret = rest.auth(None, "foo") assert ret is False
def test_auth_nouserandpass(): ret = rest.auth(None, None) assert ret is False
def test_auth_nopass(): ret = rest.auth("foo", None) assert ret is False