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

TestLiteralMeta.test_from_literal()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
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