File: test_exceptions.py

package info (click to toggle)
python-yarg 0.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 752 kB
  • sloc: python: 732; xml: 59; makefile: 47
file content (31 lines) | stat: -rw-r--r-- 786 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
29
30
31
import unittest

from yarg import HTTPError


class TestHTTPErrorWithReason(unittest.TestCase):

    def setUp(self):
        self.error = HTTPError(status_code=300,
                               reason="Test")

    def test_repr(self):
        self.assertEqual('<HTTPError 300 Test>',
                         self.error.__repr__())

    def test_str(self):
        self.assertEqual('<HTTPError 300 Test>',
                         self.error.__str__())

class TestHTTPErrorNoReason(unittest.TestCase):

    def setUp(self):
        self.error = HTTPError()

    def test_repr(self):
        self.assertEqual('<HTTPError>',
                         self.error.__repr__())

    def test_str(self):
        self.assertEqual('<HTTPError>',
                         self.error.__str__())