コード例 #1
0
    def test_delete_file_fails(self, mocker):
        connection = mocker.MagicMock()
        connection \
            .cursor.return_value \
            .execute.side_effect = sqlite3.Error()

        indexer = Indexer(connection, mocker.Mock())
        assert indexer.delete(File("/full/path.log", "path.log")) is False
コード例 #2
0
    def test_delete_file_from_index(self, mocker):
        connection = mocker.MagicMock()

        indexer = Indexer(connection, mocker.Mock())
        assert indexer.delete(File("/full/path.log", "path.log")) is True