Remove redundant test_copy_db_scram_sha_1.

This commit is contained in:
Bernie Hackett 2015-01-28 11:05:57 -08:00
parent 720a141227
commit 84c34a3d45

View File

@ -296,7 +296,6 @@ class TestSCRAMSHA1(unittest.TestCase):
client.pymongo_test.add_user(
'user', 'pass', roles=['userAdmin', 'readWrite'])
def test_scram_sha1(self):
client = MongoClient(host, port)
self.assertTrue(client.pymongo_test.authenticate(
@ -322,46 +321,6 @@ class TestSCRAMSHA1(unittest.TestCase):
client.read_preference = ReadPreference.SECONDARY
client.pymongo_test.command('dbstats')
def test_copy_db_scram_sha_1(self):
if self.is_mongos:
raise SkipTest("mongos can't do copydb with auth")
auth_context.client.drop_database('pymongo_test2')
if self.set_name:
client = MongoReplicaSetClient(
'mongodb://localhost:%d/?replicaSet=%s' % (port, self.set_name))
else:
client = MongoClient(host, port)
client.admin.authenticate(db_user, db_pwd, mechanism='SCRAM-SHA-1')
try:
client.pymongo_test.collection.insert({})
# No from_host.
client.copy_database(from_name='pymongo_test',
to_name='pymongo_test2',
username='user',
password='pass')
self.assertTrue('pymongo_test2'
in auth_context.client.database_names())
# With from_host.
client.copy_database(from_name='pymongo_test',
to_name='pymongo_test3',
from_host='%s:%s' % (host, port),
username='user',
password='pass')
self.assertTrue('pymongo_test3'
in auth_context.client.database_names())
finally:
auth_context.client.drop_database('pymongo_test')
auth_context.client.drop_database('pymongo_test2')
auth_context.client.drop_database('pymongo_test3')
def tearDown(self):
auth_context.client.pymongo_test.remove_user('user')