I have a module A
, which contains below two functions:
def my_func():
my_dict = {"key1":100, "key2": 100}
send_result(dicts=my_dict)
def send_result(dicts):
print(dicts)
I have written unit test case as below:
from unittest.mock import MagicMock
import A
def test_send_results(self, dicts):
self.assertGreater(len(dicts), 0)
def test_my_func(self):
A.send_result = MagicMock(wraps=self.test_send_results)
A.my_func()
And when I am running unit test case, I am getting below error though dicts contains the value:
TypeError: test_send_results() missing 1 required positional argument: 'dicts'