Skip to content

Commit

Permalink
Spelling.
Browse files Browse the repository at this point in the history
  • Loading branch information
behackett committed Feb 23, 2013
1 parent 40f241d commit a59255f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/test_auth.py
Expand Up @@ -35,26 +35,26 @@
# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS.
GSSAPI_HOST = os.environ.get('GSSAPI_HOST')
GSSAPI_PORT = int(os.environ.get('GSSAPI_PORT', '27017'))
PRINCIPLE = os.environ.get('PRINCIPLE')
PRINCIPAL = os.environ.get('PRINCIPAL')

class TestGSSAPI(unittest.TestCase):

def setUp(self):
if not HAVE_KERBEROS:
raise SkipTest('Kerberos module not available.')
if not GSSAPI_HOST:
raise SkipTest('Must set GSSAPI_HOST and PRINCIPLE to test GSSAPI')
raise SkipTest('Must set GSSAPI_HOST and PRINCIPAL to test GSSAPI')

def test_gssapi_simple(self):

client = MongoClient(GSSAPI_HOST, GSSAPI_PORT)
self.assertTrue(client.test.authenticate(PRINCIPLE,
self.assertTrue(client.test.authenticate(PRINCIPAL,
mechanism='GSSAPI'))
# Just test that we can run a simple command.
self.assertTrue(client.database_names())

uri = ('mongodb://%s@%s:%d/?authMechanism='
'GSSAPI' % (quote_plus(PRINCIPLE), GSSAPI_HOST, GSSAPI_PORT))
'GSSAPI' % (quote_plus(PRINCIPAL), GSSAPI_HOST, GSSAPI_PORT))
client = MongoClient(uri)
self.assertTrue(client.database_names())

Expand All @@ -63,11 +63,11 @@ def test_gssapi_simple(self):
client = MongoReplicaSetClient(GSSAPI_HOST,
port=GSSAPI_PORT,
replicaSet=set_name)
self.assertTrue(client.test.authenticate(PRINCIPLE,
self.assertTrue(client.test.authenticate(PRINCIPAL,
mechanism='GSSAPI'))
self.assertTrue(client.database_names())
uri = ('mongodb://%s@%s:%d/?authMechanism=GSSAPI;replicaSet'
'=%s' % (quote_plus(PRINCIPLE),
'=%s' % (quote_plus(PRINCIPAL),
GSSAPI_HOST, GSSAPI_PORT, set_name))
client = MongoReplicaSetClient(uri)
self.assertTrue(client.database_names())
Expand All @@ -77,7 +77,7 @@ def test_gssapi_threaded(self):
# Use auto_start_request=True to make sure each thread
# uses a different socket.
client = MongoClient(GSSAPI_HOST, auto_start_request=True)
self.assertTrue(client.test.authenticate(PRINCIPLE,
self.assertTrue(client.test.authenticate(PRINCIPAL,
mechanism='GSSAPI'))

result = True
Expand All @@ -103,7 +103,7 @@ def try_command():
client = MongoReplicaSetClient(GSSAPI_HOST,
replicaSet=set_name,
read_preference=preference)
self.assertTrue(client.test.authenticate(PRINCIPLE,
self.assertTrue(client.test.authenticate(PRINCIPAL,
mechanism='GSSAPI'))
self.assertTrue(client.foo.command('dbstats'))

Expand Down

0 comments on commit a59255f

Please sign in to comment.