How to mock JClass call in python unit tests

62 views Asked by At

I am new to python unit test mocking. I am using jpype library in the code like below:

def my_func():
  #some code
  instance. = JClass("myapp.myclass")()
  #some code

This is the test code:

def test_my_func():
 my_func()

Here how to mock JClass() call?

Thanks in advance.

0

There are 0 answers