Skip to content

Commit

Permalink
Additional test pep8/pylint cleanup
Browse files Browse the repository at this point in the history
Cleaning up the module itself could be a pain, but no reason not to keep the tests reasonably compliant
  • Loading branch information
nickcatal committed Nov 28, 2013
1 parent d5c8188 commit f536f64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Expand Up @@ -38,7 +38,7 @@ load-plugins=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=too-many-public-methods,too-few-public-methods,no-member,super-on-old-class,too-many-ancestors,I0011,deprecated-disable-all,file-ignored
disable=too-many-public-methods,too-few-public-methods,no-member,super-on-old-class,too-many-ancestors,I0011,deprecated-disable-all,file-ignored,import-error,no-name-in-module,maybe-no-member


[REPORTS]
Expand Down
1 change: 1 addition & 0 deletions simple_salesforce/tests/__init__.py
@@ -0,0 +1 @@
"""Simple-Salesforce Tests"""
10 changes: 8 additions & 2 deletions simple_salesforce/tests/test_login.py
Expand Up @@ -12,10 +12,15 @@
# Python 3
from unittest.mock import Mock, patch

from simple_salesforce.login import SalesforceLogin, SalesforceAuthenticationFailed
from simple_salesforce.login import (
SalesforceLogin, SalesforceAuthenticationFailed
)

class TestExceptionHandler(unittest.TestCase):

class TestSalesforceLogin(unittest.TestCase):
"""Tests for the SalesforceLogin function"""
def setUp(self):
"""Setup the SalesforceLogin tests"""
request_patcher = patch('simple_salesforce.login.requests')
self.mockrequest = request_patcher.start()
self.addCleanup(request_patcher.stop)
Expand All @@ -24,6 +29,7 @@ def test_failure(self):
"""Test A Failed Login Response"""
return_mock = Mock()
return_mock.status_code = 500
# pylint: disable=line-too-long
return_mock.content = '<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring><detail><sf:LoginFault xsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage></sf:LoginFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>'
self.mockrequest.post.return_value = return_mock

Expand Down

0 comments on commit f536f64

Please sign in to comment.