mock session.get;

This commit is contained in:
Marco Zeisler 2021-06-17 22:29:07 +02:00
parent a18c0660f3
commit 56a4c67fd8
2 changed files with 22 additions and 0 deletions

View File

@ -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):
...

View File

@ -0,0 +1,7 @@
class MyResponse:
def __init__(self, *args, **kwargs):
...
@staticmethod
def json(*args, **kwargs):
return {'cursor': []}