Esempio n. 1
0
 def test_Connection(self):
     from niprov.mongo import MongoRepository
     with patch('niprov.mongo.pymongo') as pymongo:
         repo = MongoRepository(dependencies=self.dependencies)
     pymongo.MongoClient.assert_called_with(self.config.database_url)
     self.assertEqual(pymongo.MongoClient().get_default_database(), repo.db)
Esempio n. 2
0
 def setupRepo(self):
     from niprov.mongo import MongoRepository
     with patch('niprov.mongo.pymongo') as self.pymongo:
         self.repo = MongoRepository(dependencies=self.dependencies)
     self.repo.db = self.db