Skip to content

Instantly share code, notes, and snippets.

@norrs
Created September 29, 2012 16:26
Show Gist options
  • Save norrs/3804514 to your computer and use it in GitHub Desktop.
Save norrs/3804514 to your computer and use it in GitHub Desktop.
class LDAPTestCase(unittest2.TestCase):
def setUp(self):
simpleldap.Connection = mock.MagicMock(name='simpleldap.Connection')
self.module = LDAP()
def test_if_protocol_is_ssl_on_ssl_port(self):
self.module.connect('foo', 636, None, 'ldap')
self.assertEquals('ldaps', self.module.protocol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment