def test_003_multiple(self): with LibZFSHandle() as ptr: ptr2 = LibZFSHandle.init() refcount = LibZFSHandle.refcount() LibZFSHandle.fini() assert refcount > 1 assert ptr == ptr2 assert LibZFSHandle.refcount() == (refcount - 1)
def test_002_manual(self): LibZFSHandle.init() LibZFSHandle.fini()
def setUpClass(cls): LibZFSHandle.init()
def tearDown(self): LibZFSHandle.fini()
def setUp(self): LibZFSHandle.init()
def tearDownClass(cls): LibZFSHandle.fini()
@app.route('/') def root(): return send_from_directory('static', 'index.html'); # Define the API Basics api = restful.Api(app) # Models from models.disk import Disk from models.zfs import Pool from models.zfs import Filesystem from models.smart import SmartInfo from models.stats import Stats from models.update import Update # URL Definitions api.add_resource(Pool, '/api/pools') api.add_resource(Disk, '/api/disks') api.add_resource(Filesystem, '/api/filesystems') api.add_resource(SmartInfo, '/api/smart/<string:disk>') api.add_resource(Stats, '/api/stats') api.add_resource(Update, '/api/update') # Start the application if __name__ == '__main__': with LibZFSHandle(): app.run(host=config.get('host', '0.0.0.0'), port=config.get('port', 5000)) # vim: ts=4 sw=4 sts=4 noet