From 7960529ee91d6883d3b6a285909b4c0e8ffb1fc6 Mon Sep 17 00:00:00 2001 From: Shreya Date: Thu, 18 Feb 2021 19:41:29 +0530 Subject: [PATCH] Add conftest.py --- .../infection_monkey/telemetry/tests/conftest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 monkey/infection_monkey/telemetry/tests/conftest.py diff --git a/monkey/infection_monkey/telemetry/tests/conftest.py b/monkey/infection_monkey/telemetry/tests/conftest.py new file mode 100644 index 000000000..dab650174 --- /dev/null +++ b/monkey/infection_monkey/telemetry/tests/conftest.py @@ -0,0 +1,15 @@ +import pytest + +from infection_monkey.control import ControlClient + + +@pytest.fixture +def spy_send_telemetry(monkeypatch): + def _spy_send_telemetry(telem_category, data): + _spy_send_telemetry.telem_category = telem_category + _spy_send_telemetry.data = data + + _spy_send_telemetry.telem_category = None + _spy_send_telemetry.data = None + monkeypatch.setattr(ControlClient, 'send_telemetry', _spy_send_telemetry) + return _spy_send_telemetry