musicmuster/tests/test_misc.py
2025-08-18 13:11:35 +01:00

36 lines
701 B
Python

# Standard library imports
import unittest
# PyQt imports
# Third party imports
import pytest
# App imports
import ds
class TestMMMisc(unittest.TestCase):
def setUp(self):
ds.db.create_all()
def tearDown(self):
ds.db.drop_all()
def test_log_exception(self):
"""Test deliberate exception"""
with pytest.raises(Exception):
1 / 0
def test_create_settings(self):
SETTING_NAME = "wombat"
VALUE = 3
test_non_existant = ds.setting_get(SETTING_NAME)
assert test_non_existant is None
ds.setting_set(SETTING_NAME, VALUE)
test_ok = ds.setting_get(SETTING_NAME)
assert test_ok == VALUE