File: test_steps.py

package info (click to toggle)
python-django-structlog 9.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,004 kB
  • sloc: python: 3,509; sh: 206; javascript: 79; makefile: 19
file content (18 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from unittest.mock import patch

from django.test import TestCase

from django_structlog.celery import steps


class TestDjangoStructLogInitStep(TestCase):
    def test_call(self) -> None:
        with patch(
            "django_structlog.celery.receivers.CeleryReceiver.connect_worker_signals",
            autospec=True,
        ) as mock_connect:
            step = steps.DjangoStructLogInitStep(None)

        mock_connect.assert_called_once()

        self.assertIsNotNone(step.receiver)