Completed
Push — develop ( b4a21c...b1df34 )
by Jace
02:37
created

yorm.test.TestConverter   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 15
Duplicated Lines 0 %
Metric Value
dl 0
loc 15
rs 10
wmc 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestConverter.test_converter_class_methods_cannot_be_called() 0 7 4
A TestConverter.test_converter_class_cannot_be_instantiated() 0 3 2
1
# pylint: disable=missing-docstring,no-self-use,abstract-class-instantiated
2
3
import pytest
4
5
from yorm.bases import Converter
6
7
8
class TestConverter:
9
10
    """Unit tests for the `Converter` class."""
11
12
    def test_converter_class_cannot_be_instantiated(self):
13
        with pytest.raises(TypeError):
14
            Converter()
15
16
    def test_converter_class_methods_cannot_be_called(self):
17
        with pytest.raises(NotImplementedError):
18
            Converter.create_default()
19
        with pytest.raises(NotImplementedError):
20
            Converter.to_value(None)
21
        with pytest.raises(NotImplementedError):
22
            Converter.to_data(None)
23