import pytest

from edpconfigprovider.exceptions import NoConfigurationException


class TestNoConfigurationException:
    def test_message_format(self):
        exc = NoConfigurationException(configuration_name="my_config")
        assert str(exc) == "No configuration for my_config"

    def test_is_exception_subclass(self):
        assert issubclass(NoConfigurationException, Exception)

    def test_raises_and_catches(self):
        with pytest.raises(NoConfigurationException, match="my_config"):
            raise NoConfigurationException(configuration_name="my_config")
