cocluto/test/test_cocluto.py

30 lines
942 B
Python

import unittest
import logging
# from cocluto import ClusterController
from cocluto.ClusterController.QstatParser import QstatParser
from cocluto.ClusterController.JobsState import JobsState
class CoclutoTestCase(unittest.TestCase):
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def setUp(self) -> None:
return super().setUp()
def test_qstat_parser(self):
logging.info('test_qstat_parser')
# command = ['qstat', '-f', '-u', '*', '-pri']
with open('test/qstat-output-001.txt', 'rt') as file:
qstat_output = file.read()
# qstatParser = ClusterController.QstatParser()
qstatParser = QstatParser()
job_state = qstatParser.parseQstatOutput(qstat_output)
self.assertIsInstance(job_state, JobsState)
# self.assertEqual(rv.status, '200 OK')
if __name__ == '__main__':
unittest.main()