File: exception_test.py

package info (click to toggle)
pyvlx 0.2.32-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,616 kB
  • sloc: python: 9,114; makefile: 53; sh: 5
file content (21 lines) | stat: -rw-r--r-- 759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Unit test for roller shutter."""
import unittest

from pyvlx.exception import PyVLXException


class TestException(unittest.TestCase):
    """Test class for roller shutter."""

    def test_str(self) -> None:
        """Test string representation of PyVLXException."""
        exception = PyVLXException("fnord fnord")
        self.assertEqual(str(exception), '<PyVLXException description="fnord fnord" />')

    def test_str_with_parameter(self) -> None:
        """Test string representation of PyVLXException with parameter."""
        exception = PyVLXException("fnord fnord", fnord="fnord", bla="blub")
        self.assertEqual(
            str(exception),
            '<PyVLXException description="fnord fnord" bla="blub" fnord="fnord"/>',
        )