Ejemplo n.º 1
0
def create_bar():
    with sudo(user='******'), cd('/srv/'):
        if exists('/tmp/foo'):
            mkdir('/tmp/foo/bar')
        else:
            print('/tmp/foo does not exist')
            ls('tamer')
Ejemplo n.º 2
0
def put_file():
    with sudo(user='******'):
        put('README.md', '/tmp/foobarbaz')
        ls('/tmp/foobarbaz')
        run('cat /tmp/foobarbaz')
        put(StringIO('foobarbazéé'), '/tmp/foobarbaz')
        run('cat /tmp/foobarbaz')
Ejemplo n.º 3
0
def test_ls(connection, capsys):
    assert 'hosts' in ls('/etc/').stdout
    out, err = capsys.readouterr()
    assert 'hosts' in out
Ejemplo n.º 4
0
def test_ls_without_list(patch_client):
    assert usine.ls('/tmp/foo', list=False) == \
        "sh -c $'ls --all --human-readable --size /tmp/foo'"
Ejemplo n.º 5
0
def test_ls_without_all(patch_client):
    assert usine.ls('/tmp/foo', all=False) == \
        "sh -c $'ls --human-readable --size -l /tmp/foo'"
Ejemplo n.º 6
0
def test_ls_without_human_readable(patch_client):
    assert usine.ls('/tmp/foo', human_readable=False) == \
        "sh -c $'ls --all --size -l /tmp/foo'"
Ejemplo n.º 7
0
def test_ls(patch_client):
    assert usine.ls('/tmp/foo') == \
        "sh -c $'ls --all --human-readable --size -l /tmp/foo'"