示例#1
0
 async def test_get2(self):
     """test of mocked method get"""
     database = DatabaseMongo({})
     database.database = {}
     database.database['test'] = DatabaseMongoTest({})
     try:
         await database.get("test")
     except TypeError:
         pass
     else:
         raise Exception
示例#2
0
 async def test_get2(self):
     """test of mocked method get"""
     database = DatabaseMongo({})
     database.database = {}
     database.database['test'] = DatabaseMongoTest({})
     try:
         await database.get("test")
     except TypeError:
         pass
     else:
         raise Exception
示例#3
0
 async def test_put(self):
     """test of mocked  put"""
     database = DatabaseMongo({})
     database.database = {}
     database.database['test'] = DatabaseMongoTest({})
     try:
         await database.put("test", {"_id": "0", "key": "value"})
     except TypeError:
         try:
             await database.put("test", {})
         except NotImplementedError:
             raise Exception
         else:
             pass
     else:
         raise Exception
示例#4
0
 async def test_put(self):
     """test of mocked  put"""
     database = DatabaseMongo({})
     database.database = {}
     database.database['test'] = DatabaseMongoTest({})
     try:
         await database.put("test", {"_id":"0" , "key":"value"})
     except TypeError:
         try:
             await database.put("test", {})
         except NotImplementedError:
             raise Exception
         else:
             pass
     else:
         raise Exception