Exemplo n.º 1
0
    def test_no_opening(self, tmpdir, capsys):
        srcpath = fixture_dir('cli', 'batch_no_open')
        dir_util.copy_tree(srcpath, str(tmpdir))

        npc.cli.start(['--campaign', str(tmpdir), 'h', 'manny', '--batch'])
        output, _ = capsys.readouterr()

        assert output == ''
Exemplo n.º 2
0
def test_failed_command(tmpdir, capsys):
    srcpath = fixture_dir('cli', 'failed_command')
    dir_util.copy_tree(srcpath, str(tmpdir))

    npc.cli.start(['--campaign', str(tmpdir), 'h', 'manny'])
    _, err = capsys.readouterr()

    assert 'No such file or directory' in err
Exemplo n.º 3
0
def test_bad_path(capsys):
    npc.cli.start(['--campaign', fixture_dir('cli', 'nope')])
    _, err = capsys.readouterr()

    assert 'No such file or directory' in err