tests.test_update.TestUpdate.test_update()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
import pytest
2
3
from tyrannosaurus.context import Context
4
from tyrannosaurus.update import Update
5
6
from . import TestResources
7
8
9
class TestUpdate:
10
    def test_update(self):
11
        with TestResources.temp_dir("fake") as path:
12
            # TODO use a fake pypi getter
13
            context = Context(path, dry_run=True)
14
            update = Update(context)
15
            pkgs, devs = update.update()
16
            # cheat flake8 here:
17
            assert [x for x in sorted(pkgs.keys())] == ["requests", "tomlkit", "typer"]
18
            assert list(devs) == ["pytest"]
19
20
21
if __name__ == "__main__":
22
    pytest.main()
23