32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from pathlib import Path
|
|
import unittest
|
|
import logging
|
|
# from cocluto import ClusterController
|
|
from cocluto.SimpaDbUtil import SqliteDb
|
|
from cocluto.quman import QueueManager, init_db
|
|
|
|
|
|
class QumanTestCase(unittest.TestCase):
|
|
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
|
def setUp(self) -> None:
|
|
return super().setUp()
|
|
|
|
def test_quman(self):
|
|
logging.info('test_quman')
|
|
db_path = Path('./quman_test/quman.sqlite')
|
|
if db_path.exists():
|
|
db_path.unlink()
|
|
db_backend = SqliteDb(db_path)
|
|
init_db(db_backend)
|
|
quman = QueueManager(db_backend)
|
|
quman.request_queue_deactivation('main.q@alambix42', 'sysadmin.graffy', 'because I want to test quman')
|
|
quman.request_queue_activation('main.q@alambix42', 'sysadmin.graffy', 'because I want to test quman')
|
|
# self.assertIsInstance(job_state, JobsState)
|
|
db_backend.dump(Path('./quman_test/quman_dump.sql'))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|