mercredi 29 avril 2015

how do you test private static method in module in python

we have a module of static methods in our python app. these methods use a lot of private (e.g: "__do_sub_task2(**args)") I would like to write unit tests for these private static methods within this module, but I am getting refernce errors.

is there a way to do this?

update: adding scenario

I have a module file named 'my_module.py' contents of said file is as follows:

def public_method_foo(my_number):
  return __sub_method_bar(my_number * 10)

def __sub_method_bar(other_number)
  return other_number + 11

Aucun commentaire:

Enregistrer un commentaire