コード例 #1
0
ファイル: test_downloads.py プロジェクト: AbelMon/librarian
def test_safe_remove_fail(unlink):
    file_path = '/path/file.zip'
    unlink.side_effect = OSError()
    assert not mod.safe_remove(file_path)
    unlink.assert_called_once_with(file_path)
コード例 #2
0
ファイル: test_downloads.py プロジェクト: AbelMon/librarian
def test_safe_remove_success(unlink):
    file_path = '/path/file.zip'
    assert mod.safe_remove(file_path)
    unlink.assert_called_once_with(file_path)