From 56a4c67fd82d34cdef3dc6cad43f7a3c9ee79eba Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Thu, 17 Jun 2021 22:29:07 +0200 Subject: [PATCH] mock session.get; --- components/orchestration/test_orchestrator.py | 15 +++++++++++++++ .../shared/dse_shared_libs/mock/response.py | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 components/orchestration/test_orchestrator.py create mode 100644 components/shared/dse_shared_libs/mock/response.py diff --git a/components/orchestration/test_orchestrator.py b/components/orchestration/test_orchestrator.py new file mode 100644 index 0000000..4cb7a2e --- /dev/null +++ b/components/orchestration/test_orchestrator.py @@ -0,0 +1,15 @@ +import unittest +from unittest.mock import patch + +from dse_shared_libs.mock.response import MyResponse + +from orchestrator import Orchestrator + + +class TestOrchestrator(unittest.TestCase): + def setUp(self) -> None: + with patch('requests.sessions.Session.get', MyResponse): + self.orc = Orchestrator() + + def test(self): + ... \ No newline at end of file diff --git a/components/shared/dse_shared_libs/mock/response.py b/components/shared/dse_shared_libs/mock/response.py new file mode 100644 index 0000000..93e33d5 --- /dev/null +++ b/components/shared/dse_shared_libs/mock/response.py @@ -0,0 +1,7 @@ +class MyResponse: + def __init__(self, *args, **kwargs): + ... + + @staticmethod + def json(*args, **kwargs): + return {'cursor': []}