File: test_exceptions.py

package info (click to toggle)
python-asciimatics 1.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,488 kB
  • sloc: python: 15,713; sh: 8; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 798 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
22
23
24
25
26
27
28
import unittest
from asciimatics.exceptions import ResizeScreenError, StopApplication
from asciimatics.scene import Scene
from tests.mock_objects import MockEffect


class TestExceptions(unittest.TestCase):
    def test_resize(self):
        """
        Check that we can create a ResizeScreenError
        """
        scene = Scene([MockEffect()])
        message = "Test message"
        error = ResizeScreenError(message, scene)
        self.assertEqual(error.scene, scene)
        self.assertEqual(str(error), message)

    def test_stop_app(self):
        """
        Check that we can create a StopApplication.
        """
        message = "Test message"
        error = StopApplication(message)
        self.assertEqual(str(error), message)


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