def test_dump_to_json_dumps(self): if os.path.exists(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson.json'): os.remove(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson.json') output_path = os.path.dirname(os.path.realpath(__file__)) + '/' + 'data/output.bson.json' collection = BsonCollection(os.path.dirname(os.path.realpath(__file__)) +'/'+ config['bson']['valid']) collection.dump_to_json(output_path) self.assertTrue(os.path.getsize(output_path) > 0) if os.path.exists(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson.json'): os.remove(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson.json')
def test_dump_to_json_dumps(self): if os.path.exists( os.path.dirname(os.path.abspath(__file__)) + '/data/output.bson.json'): os.remove( os.path.dirname(os.path.abspath(__file__)) + '/data/output.bson.json') output_path = os.path.dirname( os.path.realpath(__file__)) + '/' + 'data/output.bson.json' collection = BsonCollection( os.path.dirname(os.path.realpath(__file__)) + '/' + config['bson']['valid']) collection.dump_to_json(output_path) self.assertTrue(os.path.getsize(output_path) > 0) if os.path.exists( os.path.dirname(os.path.abspath(__file__)) + '/data/output.bson.json'): os.remove( os.path.dirname(os.path.abspath(__file__)) + '/data/output.bson.json')