示例#1
0
    def test_split_file_local_fail(self, monkeypatch: MonkeyPatch):
        class MockOpen2(MockOpen):
            def __init__(self, *args):
                pass

            def seek(self, bytes):
                raise OSError

        scput = SplitCopyPut()
        scput.scs = MockSplitCopyShared()
        monkeypatch.setattr("builtins.open", MockOpen2)
        file_size = 100000
        split_size = 10000
        with raises(SystemExit):
            scput.split_file_local(file_size, split_size)
示例#2
0
 def test_split_file_local(self, monkeypatch: MonkeyPatch):
     scput = SplitCopyPut()
     monkeypatch.setattr("builtins.open", MockOpen)
     file_size = 100000
     split_size = 3000
     result = scput.split_file_local(file_size, split_size)
     assert result == None