lundi 18 avril 2016

Mocking class constructor default parameters in Python

Is there a way to mock just the default parameters of a class constructor? For example, if I have this class:

  class A (object):
      def __init__(self, details='example'):
          self.details = details

Is there a way to a mock just the default value of the details argument, eg to details='test'?

Aucun commentaire:

Enregistrer un commentaire