コード例 #1
0
ファイル: test_reican.py プロジェクト: fxlv/reican
def test_get_opening_lzma():
    opener = reican.get_opener(test_file_name + ".lzma", stats)
    with opener("test/test.log.lzma") as logfile:
        assert len(logfile.readlines()) == 3
コード例 #2
0
ファイル: test_reican.py プロジェクト: fxlv/reican
def test_opening_plaintext():
    opener = reican.get_opener(test_file_name, stats)
    with opener("test/test.log") as logfile:
        assert len(logfile.readlines()) == 3
コード例 #3
0
ファイル: test_reican.py プロジェクト: fxlv/reican
def test_get_opener_lzma_type():
    opener = reican.get_opener(test_file_name + ".lzma", stats)
    assert isinstance(opener, types.FunctionType)
コード例 #4
0
ファイル: test_reican.py プロジェクト: fxlv/reican
def test_get_opener_lzma_missing():
    """Test LZMA opener when LZMA module is missing."""
    with mock.patch.dict('sys.modules', {'backports.lzma': None}):
        with pytest.raises(SystemExit):
            opener = reican.get_opener(test_file_name + ".lzma", stats)
            assert isinstance(opener, types.FunctionType)
コード例 #5
0
ファイル: test_reican.py プロジェクト: fxlv/reican
def test_get_opener_type():
    opener = reican.get_opener(test_file_name, stats)
    assert isinstance(opener, types.BuiltinFunctionType)