# Path: ndscheduler/corescheduler/scheduler_manager.py
# class SchedulerManager:
#     def __init__(self, scheduler_class_path,
#                  datastore_class_path,
#                  db_config=None,
#                  db_tablenames=None,
#                  job_coalesce=constants.DEFAULT_JOB_COALESCE,
#                  job_misfire_grace_sec=constants.DEFAULT_JOB_MISFIRE_GRACE_SEC,
#                  job_max_instances=constants.DEFAULT_JOB_MAX_INSTANCES,
#                  thread_pool_size=constants.DEFAULT_THREAD_POOL_SIZE,
#                  timezone=constants.DEFAULT_TIMEZONE):
#     def get_datastore(self):
#     def start(self):
#     def stop(self):
#     def add_job(self, job_class_string, name, pub_args=None, month=None,
#                 day_of_week=None, day=None, hour=None, minute=None, **kwargs):
#     def pause_job(self, job_id):
#     def get_job(self, job_id):
#     def get_jobs(self):
#     def get_job_task_class(self, job):
#     def remove_job(self, job_id):
#     def resume_job(self, job_id):
#     def modify_job(self, job_id, **kwargs):
# 
# Path: ndscheduler/corescheduler/utils.py
# def import_from_path(path):
# def get_current_datetime():
# def get_job_name(job):
# def get_job_args(job):
# def get_job_kwargs(job):
# def get_cron_strings(job):
# def generate_uuid():
# def get_stacktrace():
# def get_hostname():
# def get_pid():
# def get_datastore_instance(datastore_class_path, db_config=None, db_tablenames=None):


from builtins import str
from ndscheduler.corescheduler import scheduler_manager
from ndscheduler.corescheduler import utils
import tornado.testing
        self.scheduler = scheduler_manager.SchedulerManager(scheduler_class, datastore_class)
        self.scheduler.start()

    def tearDown(self, *args, **kwargs):
        self.scheduler.stop()
        super(SchedulerManagerTest, self).tearDown(*args, **kwargs)

    @tornado.testing.gen_test
    def test_add_job_get_job(self):
        task_name = 'hello.world'
        name = 'it is hello world'
        pub_args = ('1', '2', '3')
        month = '*/1'
        day_of_week = 'sat'
        day = '*/2'
        hour = '*/3'
        minute = '*/4'

        # non-blocking operation
        job_id = self.scheduler.add_job(task_name, name, pub_args, month, day_of_week, day,
                                        hour, minute, languages='en-us')

        self.assertTrue(len(job_id), 32)

        # blocking operation
        job = self.scheduler.get_job(job_id)
        self.assertEqual(self.scheduler.get_job_task_class(job), task_name)
        self.assertEqual(job.id, job_id)
        self.assertEqual(job.name, name)
        self.assertEqual(utils.get_job_args(job), pub_args)

# Path: ndscheduler/corescheduler/scheduler_manager.py
# class SchedulerManager:
#     def __init__(self, scheduler_class_path,
#                  datastore_class_path,
#                  db_config=None,
#                  db_tablenames=None,
#                  job_coalesce=constants.DEFAULT_JOB_COALESCE,
#                  job_misfire_grace_sec=constants.DEFAULT_JOB_MISFIRE_GRACE_SEC,
#                  job_max_instances=constants.DEFAULT_JOB_MAX_INSTANCES,
#                  thread_pool_size=constants.DEFAULT_THREAD_POOL_SIZE,
#                  timezone=constants.DEFAULT_TIMEZONE):
#     def get_datastore(self):
#     def start(self):
#     def stop(self):
#     def add_job(self, job_class_string, name, pub_args=None, month=None,
#                 day_of_week=None, day=None, hour=None, minute=None, **kwargs):
#     def pause_job(self, job_id):
#     def get_job(self, job_id):
#     def get_jobs(self):
#     def get_job_task_class(self, job):
#     def remove_job(self, job_id):
#     def resume_job(self, job_id):
#     def modify_job(self, job_id, **kwargs):
# 
# Path: ndscheduler/corescheduler/utils.py
# def import_from_path(path):
# def get_current_datetime():
# def get_job_name(job):
# def get_job_args(job):
# def get_job_kwargs(job):
# def get_cron_strings(job):
# def generate_uuid():
# def get_stacktrace():
# def get_hostname():
# def get_pid():
# def get_datastore_instance(datastore_class_path, db_config=None, db_tablenames=None):


# Path: ndscheduler/corescheduler/scheduler_manager_test.py
from builtins import str
from ndscheduler.corescheduler import scheduler_manager
from ndscheduler.corescheduler import utils
import tornado.testing

        self.scheduler = scheduler_manager.SchedulerManager(scheduler_class, datastore_class)
        self.scheduler.start()

    def tearDown(self, *args, **kwargs):
        self.scheduler.stop()
        super(SchedulerManagerTest, self).tearDown(*args, **kwargs)

    @tornado.testing.gen_test
    def test_add_job_get_job(self):
        task_name = 'hello.world'
        name = 'it is hello world'
        pub_args = ('1', '2', '3')
        month = '*/1'
        day_of_week = 'sat'
        day = '*/2'
        hour = '*/3'
        minute = '*/4'

        # non-blocking operation
        job_id = self.scheduler.add_job(task_name, name, pub_args, month, day_of_week, day,
                                        hour, minute, languages='en-us')

        self.assertTrue(len(job_id), 32)

        # blocking operation
        job = self.scheduler.get_job(job_id)
        self.assertEqual(self.scheduler.get_job_task_class(job), task_name)
        self.assertEqual(job.id, job_id)
        self.assertEqual(job.name, name)
        self.assertEqual(utils.get_job_args(job), pub_args)

        self.assertEqual(utils.get_job_kwargs(job), {'languages': 'en-us'})