Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Jul 29, 2024
1 parent f714a0e commit d4712fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/test_operations_queue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import threading
from unittest.mock import MagicMock

import pytest
from neptune_api.proto.neptune_pb.ingest.v1.common_pb2 import (
Expand Down Expand Up @@ -34,18 +35,18 @@ def test__enqueue():
def test__max_queue_size_exceeded():
# given
lock = threading.RLock()
callback = lambda _, __: 4 / 0
callback = MagicMock()
queue = OperationsQueue(lock=lock, max_size=1, max_size_exceeded_callback=callback)

# and
operation = RunOperation()

# when
queue.enqueue(operation=operation)
queue.enqueue(operation=operation)

# then
with pytest.raises(ValueError):
queue.enqueue(operation=operation)
callback.assert_called_once()


def test__max_element_size_exceeded():
Expand Down

0 comments on commit d4712fd

Please sign in to comment.