File: bw_stats.py

package info (click to toggle)
bundlewrap 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,260 kB
  • sloc: python: 20,849; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 1,386 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from bundlewrap.utils.testing import make_repo, run


def test_nondeterministic(tmpdir):
    make_repo(
        tmpdir,
        nodes={
            "node1": {
                'bundles': ["bundle1"],
            },
        },
        bundles={
            "bundle1": {
                'items': {
                    'files': {
                        "/test": {
                            'content': "foo",
                        },
                        "/test2": {
                            'content': "foo",
                        },
                    },
                },
            },
        },
    )

    stdout, stderr, rcode = run("bw stats", path=str(tmpdir))
    assert stdout == """╭───────┬───────────────────╮
│ count │ type              │
├───────┼───────────────────┤
│     1 │ nodes             │
│     0 │ groups            │
│     1 │ bundles           │
│     0 │ metadata defaults │
│     0 │ metadata reactors │
│     2 │ items             │
├───────┼───────────────────┤
│     2 │ file              │
╰───────┴───────────────────╯
""".encode('utf-8')
    assert rcode == 0