# Path: prestans/devel/exception.py
# class Base(Exception):
# 
#     def __init__(self, message, error_code=2):
#         self._error_code = error_code
#         self._message = message
# 
#     @property
#     def error_code(self):
#         return self._error_code
# 
#     @property
#     def message(self):
#         return self._message
# 
#     def __str__(self):
#         return self._message


import unittest
from prestans.devel.exception import Base



class ExceptionBaseTest(unittest.TestCase):

    def test_message(self):
        message_custom = Base("message")
        self.assertEqual(message_custom.message, "message")
        self.assertEqual(str(message_custom), "message")

    def test_error_code(self):
        error_code_default = Base("message")
        self.assertEqual(error_code_default.error_code, 2)


# Path: prestans/devel/exception.py
# class Base(Exception):
# 
#     def __init__(self, message, error_code=2):
#         self._error_code = error_code
#         self._message = message
# 
#     @property
#     def error_code(self):
#         return self._error_code
# 
#     @property
#     def message(self):
#         return self._message
# 
#     def __str__(self):
#         return self._message


# Path: tests/devel/test_exception.py
import unittest
from prestans.devel.exception import Base




class ExceptionBaseTest(unittest.TestCase):

    def test_message(self):
        message_custom = Base("message")
        self.assertEqual(message_custom.message, "message")
        self.assertEqual(str(message_custom), "message")

    def test_error_code(self):
        error_code_default = Base("message")
        self.assertEqual(error_code_default.error_code, 2)


        error_code_custom = Base("message", error_code=3)