Skip to content
Snippets Groups Projects
Commit c398dd70 authored by David Trattnig's avatar David Trattnig
Browse files

test: boot and terminate scheduler

parent affe3cc0
No related branches found
No related tags found
1 merge request!35ORM-less scheduling
Pipeline #6561 failed
#
# Aura Engine (https://gitlab.servus.at/aura/engine)
#
# Copyright (C) 2017-now() - The Aura Engine Team.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
import unittest
from aura_engine.base.config import AuraConfig
from aura_engine.base.utils import SimpleUtil as SU
from aura_engine.engine import Engine
from aura_engine.scheduling.domain import Playlist, PlaylistItem, Timeslot
from aura_engine.scheduling.scheduler import AuraScheduler
class TestSchedulingScheduler(unittest.TestCase):
"""
Testing the scheduling utils.
"""
config = None
engine: Engine
scheduler: AuraScheduler
# Setup and teardown
def setUp(self):
self.config = AuraConfig()
self.engine = Engine()
def tearDown(self):
pass
#
# Test Cases
#
def test_start_and_terminate_scheduler(self):
print(self._testMethodName)
# Boot the scheduler
scheduler = AuraScheduler(self.engine)
scheduler.timetable.delete_timetable_file()
scheduler.boot()
time.sleep(2)
self.assertTrue(scheduler.is_alive())
# Shut the scheduler down
scheduler.terminate()
time.sleep(10)
self.assertFalse(scheduler.is_alive())
if __name__ == "__main__":
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment