tests.test_sync   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestSync.test_fix_init() 0 9 1
1
from datetime import date
2
3
import pytest
4
5
from tests import TestResources
6
7
# noinspection PyProtectedMember
8
from tyrannosaurus.context import Context
9
from tyrannosaurus.sync import Sync
10
11
12
class TestSync:
13
    def test_fix_init(self):
14
        path = TestResources.resource("fake")
15
        context = Context(path, dry_run=True)
16
        sync = Sync(context)
17
        lines = sync.fix_init()
18
        assert len(lines) == 3
19
        assert lines[0] == f'__copyright__ = "Copyright {date.today().year}"'
20
        assert lines[1] == f'__date__ = "{date.today()}"'
21
        assert lines[2] == '__status__ = "Development"'
22
23
24
if __name__ == "__main__":
25
    pytest.main()
26