uber/doubles

stubbed constructor fails for a class that inherits from dict

Closed this issue · 0 comments

#Module foo
class MyClass(dict):
    "Class inheriting form dict"

double = class_double('foo.MyClass')
allow_constructor(double).and_return('foo')
double(bob='Barker') # raises a verification error

This happens because new is a builtin that accepts arguments, we don't account for this. The same issue would happen for list, tuple, etc.