tests.unit.test_version   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestVersion.test_version_immutable() 0 4 2
A TestVersion.test_set_version() 0 5 2
1
"""Test Version."""
2
import unittest
3
4
import pytest
5
6
from ims_envista.version import Version
7
8
9
class TestVersion(unittest.TestCase):
10
    """Test Version."""
11
12
    def test_set_version(self) -> None:
13
        ver = Version("1.0.0")
14
        if ver.number != "1.0.0":
15
            msg = "Expected Version 1.0.0"
16
            raise ValueError(msg)
17
18
    def test_version_immutable(self) -> None:
19
        ver = Version("1.0.0")
20
        with pytest.raises(TypeError):
21
            ver.number = "1.1.0"
22