Passed
Pull Request — master (#13)
by Ramon
01:32
created

TestLiteralMeta.test_from_literal()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 8
loc 8
rs 10
c 0
b 0
f 0
1
from unittest import TestCase
2
3
from typish import LiteralAlias
4
5
6 View Code Duplication
class TestLiteralMeta(TestCase):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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