File: test_version.py

package info (click to toggle)
python-hl7 0.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: python: 3,833; makefile: 160
file content (42 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
from unittest import TestCase
from unittest.mock import patch

from hl7.version import get_version


class GetVersionTest(TestCase):
    @patch("hl7.version.VERSION", new=(0, 4, 1))
    def test_no_modifier(self):
        self.assertEqual("0.4.1", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, ""))
    def test_empty_modifier(self):
        self.assertEqual("0.4.1", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, None))
    def test_none_modifier(self):
        self.assertEqual("0.4.1", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "final"))
    def test_final(self):
        self.assertEqual("0.4.1", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "rc"))
    def test_rc(self):
        self.assertEqual("0.4.1rc", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "rc4"))
    def test_rc_num(self):
        self.assertEqual("0.4.1rc4", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "b"))
    def test_beta(self):
        self.assertEqual("0.4.1b", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "a"))
    def test_alpha(self):
        self.assertEqual("0.4.1a", get_version())

    @patch("hl7.version.VERSION", new=(0, 4, 1, "dev"))
    def test_dev(self):
        self.assertEqual("0.4.1.dev", get_version())