samedi 16 février 2019

unit testing a MixIn class which is accessing another class method in one of its methods

I have two Mixin classes. One of the methods in a Mixin class is calling a method from another class. Everything works fine when I create a subclass by inheriting from these two Mixins.

class FirstMixin(object): def method(self): some logic here
self.method_of_sub_class()

class Subclass(object): def method_of_sub_class() pass

When I write unit test cases for FirstMixin class, its getting failed because of the method_of_sub_class call. How can I write unit test cases for the first MixIn class which is calling a method from another class?

Aucun commentaire:

Enregistrer un commentaire