I am beginner in Unit test. I would like to know how can I do mock unit test of following functions.
import ...
class A(BaseHTTPRequestHandler):
def do_GET(self):
client_ip = self.client_address[0]
if client_id == '10.10.10.10':
self._set_headers_200()
return
else:
self._set_headers_400()
return
Test Class:
import unittest
def test_A_get():
I want to test both 200 and 400 response
Can anybody help me this problem?