File: test_errors.py

package info (click to toggle)
pontos 25.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,744 kB
  • sloc: python: 44,602; makefile: 21; sh: 10; xml: 3
file content (19 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright (C) 2023 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#


import unittest

from pontos.version import VersionError


class VersionErrorTestCase(unittest.TestCase):
    def test_should_print_message(self):
        err = VersionError("foo bar")
        self.assertEqual(str(err), "foo bar")

    def test_should_raise(self):
        with self.assertRaisesRegex(VersionError, "^foo bar$"):
            raise VersionError("foo bar")