Passed
Push — master ( c3c399...6aa0ae )
by Ramon
55s queued 10s
created

tests.test_literal_meta   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestLiteralMeta.test_str() 0 2 1
A TestLiteralMeta.test_from_literal() 0 8 1
1
from unittest import TestCase
2
3
from typish import LiteralAlias
4
5
6
class TestLiteralMeta(TestCase):
7
    def test_from_literal(self):
8
9
        class LiteralMock:
10
            __args__ = (42,)
11
12
        alias = LiteralAlias.from_literal(LiteralMock)
13
14
        self.assertTrue(isinstance(42, alias))
15
16
    def test_str(self):
17
        self.assertEqual('Literal[42]', str(LiteralAlias[42]))
18