Example #1
0
def test_main_extract_all(tmpdir, capsys, sources):
    expected = 0 if expected_error_free(sources) else 1
    outdir = str(tmpdir)
    with temp_workdir(outdir):
        assert expak.simple_expak(sources) == expected
    (out, err) = capsys.readouterr()
    assert not str(out).strip()
Example #2
0
def test_main_extract_selected(tmpdir, capsys, sources, resources_in, all_found):
    expected = 0 if expected_error_free(sources) else 1
    argv = sources + list(resources_in)
    outdir = str(tmpdir)
    with temp_workdir(outdir):
        assert expak.simple_expak(argv) == expected
    (out, err) = capsys.readouterr()
    if all_found:
        assert not str(out).strip()
    else:
        assert str(out).strip().startswith("not found (or not successfully extracted):")
Example #3
0
def test_main_cmdline_args(capsys):
    assert expak.simple_expak() == 0
    (out, err) = capsys.readouterr()
    assert str(out).strip() == "not found (or not successfully extracted):\n    test"
Example #4
0
def test_main_usage(capsys):
    assert expak.simple_expak([]) == 0
    (out, err) = capsys.readouterr()
    assert str(out).lstrip().startswith("To extract all resources from pak files:")