File: bw_run.py

package info (click to toggle)
bundlewrap 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 3,260 kB
  • sloc: python: 20,849; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 754 bytes parent folder | download | duplicates (6)
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
from bundlewrap.utils.testing import host_os, make_repo, run


def test_run_ok(tmpdir):
    make_repo(
        tmpdir,
        nodes={
            "localhost": {
                'os': host_os(),
            },
        },
    )
    stdout, stderr, rcode = run("BW_TABLE_STYLE=grep bw run localhost true", path=str(tmpdir))
    assert rcode == 0
    assert b"localhost\t0" in stdout
    assert stderr == b""


def test_run_fail(tmpdir):
    make_repo(
        tmpdir,
        nodes={
            "localhost": {
                'os': host_os(),
            },
        },
    )
    stdout, stderr, rcode = run("BW_TABLE_STYLE=grep bw run localhost false", path=str(tmpdir))
    assert rcode == 0
    assert b"localhost\t1" in stdout
    assert stderr == b""