In Python, there is no existence of Private methods that cannot be accessed except inside a class. However, to define a private method prefix the member name with double underscore “__”. ... However, private methods can be accessed by calling the private methods via public methods.
Does Python have public and private?
Thus, Python provides conceptual implementation of public, protected, and private access modifiers, but not like other languages like C#, Java, C++.
Should I test private methods in Python?
The short answer is that you shouldn't test private methods directly, but only their effects on the public methods that call them. ... The test should only be accessing the class' public interface. If an object is hard to test via its public interface, it is going to be hard to use in the production code.