コード例 #1
0
ファイル: test_report.py プロジェクト: ClusterLabs/crmsh
def test_find_decompressor():
    log_file = "testfile"
    eq_(find_decompressor(log_file), "cat")
    log_file = "log.bz2"
    eq_(find_decompressor(log_file), "bzip2 -dc")
    log_file = "log.gz"
    eq_(find_decompressor(log_file), "gzip -dc")
    log_file = "log.tar.xz"
    eq_(find_decompressor(log_file), "xz -dc")

    log_file = create_tempfile()
    with open(log_file, 'w') as f:
        f.write("test")
    eq_(find_decompressor(log_file), "cat")
    os.remove(log_file)
コード例 #2
0
def test_find_decompressor():
    log_file = "testfile"
    assert find_decompressor(log_file) == "cat"
    log_file = "log.bz2"
    assert find_decompressor(log_file) == "bzip2 -dc"
    log_file = "log.gz"
    assert find_decompressor(log_file) == "gzip -dc"
    log_file = "log.tar.xz"
    assert find_decompressor(log_file) == "xz -dc"

    log_file = create_tempfile()
    with open(log_file, 'w') as f:
        f.write("test")
    assert find_decompressor(log_file) == "cat"
    os.remove(log_file)
コード例 #3
0
ファイル: test_report.py プロジェクト: jmcabandara/crmsh
def test_find_decompressor():
    log_file = "testfile"
    eq_(find_decompressor(log_file), "cat")
    log_file = "log.bz2"
    eq_(find_decompressor(log_file), "bzip2 -dc")
    log_file = "log.gz"
    eq_(find_decompressor(log_file), "gzip -dc")
    log_file = "log.tar.xz"
    eq_(find_decompressor(log_file), "xz -dc")

    log_file = create_tempfile()
    with open(log_file, 'w') as f:
        f.write("test")
    eq_(find_decompressor(log_file), "cat")
    os.remove(log_file)