Skip to content

Commit

Permalink
fix test check and point more clearly to failing project deletion (wh…
Browse files Browse the repository at this point in the history
…ich is a server side problem!!)
  • Loading branch information
denniswittich committed Feb 28, 2025
1 parent 8116cc8 commit 87da2e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions learning_loop_node/tests/annotator/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
import os
import shutil

# ====================================== REDUNDANT FIXTURES IN ALL CONFTESTS ! ======================================
import sys

import pytest

from ...globals import GLOBALS
from ...loop_communication import LoopCommunicator

# ====================================== REDUNDANT FIXTURES IN ALL CONFTESTS ! ======================================


@pytest.fixture()
async def setup_test_project(): # pylint: disable=redefined-outer-name
loop_communicator = LoopCommunicator()
await loop_communicator.delete("/zauberzeug/projects/pytest_nodelib_annotator?keep_images=true")
try:
await loop_communicator.delete("/zauberzeug/projects/pytest_nodelib_annotator?keep_images=true")
except Exception:
logging.warning("Failed to delete project")
sys.exit(1)
await asyncio.sleep(1)
project_conf = {
'project_name': 'pytest_nodelib_annotator', 'inbox': 0, 'annotate': 0, 'review': 0, 'complete': 3, 'image_style': 'beautiful',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_sio_upload(test_detector_node: DetectorNode, sio_client):
with open(test_image_path, 'rb') as f:
image_bytes = f.read()
result = await sio_client.call('upload', {'image': image_bytes})
assert result is None
assert result.get('status') == 'OK'
assert len(get_outbox_files(test_detector_node.outbox)) == 2, 'There should be one image and one .json file.'


Expand Down

0 comments on commit 87da2e4

Please sign in to comment.