#!/bin/env python3
# Repository:   https://github.com/PyFundamentals
# File Name:    test/test_exceptions.py
# Description:  test exceptions
#
# Copyright (C) 2025 Dieter J Kybelksties <github@kybelksties.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# @date: 2026-03-09
# @author: Dieter J Kybelksties

import unittest

from fundamentals.exceptions import BaseScriptError, StringUtilError, ExtendedEnumError


class ExceptionsTests(unittest.TestCase):

    def test_BaseScriptError(self):
        e = BaseScriptError()
        self.assertEqual(e.message, "")

        e = BaseScriptError("test message")
        self.assertEqual(e.message, "test message")

    def test_StringUtilError(self):
        e = StringUtilError()
        self.assertEqual(e.message, "")
        self.assertIsInstance(e, BaseScriptError)

        e = StringUtilError("string error")
        self.assertEqual(e.message, "string error")

    def test_ExtendedEnumError(self):
        e = ExtendedEnumError()
        self.assertEqual(e.message, "")
        self.assertIsInstance(e, BaseScriptError)

        e = ExtendedEnumError("enum error")
        self.assertEqual(e.message, "enum error")


if __name__ == '__main__':
    unittest.main()
