tests.test_sync.TestSync.test_fix_init()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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