def test_case_sensitive(self): class MYFUNC(GenericFunction): type = DateTime assert isinstance(func.MYFUNC().type, DateTime) assert isinstance(func.MyFunc().type, DateTime) assert isinstance(func.mYfUnC().type, DateTime) assert isinstance(func.myfunc().type, DateTime)
def test_custom_w_custom_name(self): class myfunc(GenericFunction): name = "notmyfunc" assert isinstance(func.notmyfunc(), myfunc) assert not isinstance(func.myfunc(), myfunc)
def test_custom_legacy_type(self): # in case someone was using this system class myfunc(GenericFunction): __return_type__ = DateTime assert isinstance(func.myfunc().type, DateTime)
def test_custom_type(self): class myfunc(GenericFunction): type = DateTime assert isinstance(func.myfunc().type, DateTime)
def test_custom_default_namespace(self): class myfunc(GenericFunction): pass assert isinstance(func.myfunc(), myfunc)