I have a module ex which has multiple attributes and another module that uses these attributes like this
import ex
def use_ex(attr):
z = getattr(ex,attr)
#Do something with z
In my test file, I mock the ex as I cannot import it in the test environment.
sys.modules['ex'] = Mock()
How do I specify the return_value of ex.attr when I write the test for use_ex?