def handleEnvironmentChangesProperly_withError(): beforeTestEnvironmentSettings = {**EnvironmentHelper.getSet()} inBetweenTestEnvironmentSettings = None afterTestEnvironmentSettings = None someExceptionMessage = 'some exception message' # Arrange def myBeforeAction(c, d=None): return d + c def myAfterAction(c, d=None): return c + d def myFunction(a): raise Exception(someExceptionMessage) returns = {} @Test(callBefore=myBeforeAction, argsOfCallBefore='f', kwargsOfCallBefore={'d': 'g'}, callAfter=myAfterAction, argsOfCallAfter='h', kwargsOfCallAfter={'d': 'i'}, returns=returns, environmentVariables={ SettingHelper.ACTIVE_ENVIRONMENT: None, **MUTED_LOG_HELPER_SETTINGS }) def myTest(): inBetweenTestEnvironmentSettings = EnvironmentHelper.getSet() assert ObjectHelper.isNotNone(inBetweenTestEnvironmentSettings) assert ObjectHelper.isDictionary(inBetweenTestEnvironmentSettings) assert 'a' == myFunction('a') return inBetweenTestEnvironmentSettings # Act try: inBetweenTestEnvironmentSettings = myTest() except Exception as e: exception = e afterTestEnvironmentSettings = {**EnvironmentHelper.getSet()} # Assert assert 'gf' == returns['returnOfCallBefore'] assert 'hi' == returns['returnOfCallAfter'] assert ObjectHelper.isNotEmpty(exception) assert someExceptionMessage == str(exception) assert ObjectHelper.isNotNone(beforeTestEnvironmentSettings) assert ObjectHelper.isDictionary(beforeTestEnvironmentSettings) assert ObjectHelper.isNone(inBetweenTestEnvironmentSettings) assert ObjectHelper.isNotNone(afterTestEnvironmentSettings) assert ObjectHelper.isDictionary(afterTestEnvironmentSettings) assert afterTestEnvironmentSettings == beforeTestEnvironmentSettings assert not beforeTestEnvironmentSettings == inBetweenTestEnvironmentSettings
def handleEnvironmentChangesProperly_withSuccess_whenActionsHaveNoArguments(): beforeTestEnvironmentSettings = {**EnvironmentHelper.getSet()} inBetweenTestEnvironmentSettings = None afterTestEnvironmentSettings = None MY_BEFORE_ACTION_RETURN = RandomHelper.string(minimum=10) MY_AFTER_ACTION_RETURN = RandomHelper.string(minimum=10) # Arrange def myBeforeAction(): return MY_BEFORE_ACTION_RETURN def myAfterAction(): return MY_AFTER_ACTION_RETURN def myFunction(a): return a returns = {} @Test(callBefore=myBeforeAction, callAfter=myAfterAction, returns=returns, environmentVariables={ SettingHelper.ACTIVE_ENVIRONMENT: None, **MUTED_LOG_HELPER_SETTINGS }) def myTest(): inBetweenTestEnvironmentSettings = EnvironmentHelper.getSet() assert ObjectHelper.isNotNone(inBetweenTestEnvironmentSettings) assert ObjectHelper.isDictionary(inBetweenTestEnvironmentSettings) assert 'a' == myFunction('a') return inBetweenTestEnvironmentSettings # Act inBetweenTestEnvironmentSettings = myTest() afterTestEnvironmentSettings = {**EnvironmentHelper.getSet()} # Assert assert MY_BEFORE_ACTION_RETURN == returns['returnOfCallBefore'] assert MY_AFTER_ACTION_RETURN == returns['returnOfCallAfter'] assert ObjectHelper.isNotNone(beforeTestEnvironmentSettings) assert ObjectHelper.isDictionary(beforeTestEnvironmentSettings) assert ObjectHelper.isNotNone(inBetweenTestEnvironmentSettings) assert ObjectHelper.isDictionary(inBetweenTestEnvironmentSettings) assert ObjectHelper.isNotNone(afterTestEnvironmentSettings) assert ObjectHelper.isDictionary(afterTestEnvironmentSettings) assert afterTestEnvironmentSettings == beforeTestEnvironmentSettings assert not beforeTestEnvironmentSettings == inBetweenTestEnvironmentSettings
def getErrorMessage(clientResponse, exception=None): completeErrorMessage = f'{HttpClientConstant.ERROR_AT_CLIENT_CALL_MESSAGE}{c.DOT_SPACE}{HttpClientConstant.CLIENT_DID_NOT_SENT_ANY_MESSAGE}' errorMessage = HttpClientConstant.CLIENT_DID_NOT_SENT_ANY_MESSAGE possibleErrorMessage = None bodyAsJson = {} try : bodyAsJson = clientResponse.json() except Exception as innerException : bodyAsJsonException = FlaskUtil.safellyGetResponseJson(clientResponse) log.log(getErrorMessage, f'Invalid client response: {bodyAsJsonException}', exception=innerException) log.debug(getErrorMessage, f'Not possible to get error message from client response: {bodyAsJsonException}. Proceeding with value {bodyAsJson} by default', exception=innerException, muteStackTrace=True) try: if ObjectHelper.isNotNone(clientResponse): if ObjectHelper.isDictionary(bodyAsJson): possibleErrorMessage = bodyAsJson.get('message', bodyAsJson.get('error')).strip() if ObjectHelper.isList(bodyAsJson) and 0 < len(bodyAsJson): possibleErrorMessage = bodyAsJson[0].get('message', bodyAsJson[0].get('error')).strip() if ObjectHelper.isNotNone(possibleErrorMessage) and StringHelper.isNotBlank(possibleErrorMessage): errorMessage = f'{c.LOG_CAUSE}{possibleErrorMessage}' else: log.debug(getErrorMessage, f'Client response {FlaskUtil.safellyGetResponseJson(clientResponse)}') exceptionPortion = HttpClientConstant.ERROR_AT_CLIENT_CALL_MESSAGE if ObjectHelper.isNone(exception) or StringHelper.isBlank(exception) else str(exception) completeErrorMessage = f'{exceptionPortion}{c.DOT_SPACE}{errorMessage}' except Exception as exception: log.warning(getErrorMessage, f'Not possible to get error message. Returning {completeErrorMessage} by default', exception=exception) return completeErrorMessage
def validateGeneralSessionAndReturnItDecoded(self, rawJwt=None, options=None): decodedSessionToken = rawJwt try: decodedSessionToken = self.getDecodedToken( rawJwt=decodedSessionToken, options=options) assert ObjectHelper.isDictionary( decodedSessionToken ), f'Invalid session payload type. It should be a dictionary, bu it is {type(decodedSessionToken)}' assert ObjectHelper.isNotEmpty( decodedSessionToken), 'Session cannot be empty' jti = getJti(rawJwt=decodedSessionToken) assert ObjectHelper.isNotNone(jti), f'JWT jti cannot be None' assert jti not in BLACK_LIST, f'Session {jti} already revoked' nbf = getNfb(rawJwt=decodedSessionToken) assert ObjectHelper.isNotNone(nbf), f'JWT nbf cannot be None' assert UtcDateTimeUtil.now() >= UtcDateTimeUtil.ofTimestamp( nbf ), f'JWT session token not valid before {UtcDateTimeUtil.ofTimestamp(nbf)}' expiration = getExpiration(rawJwt=decodedSessionToken) assert UtcDateTimeUtil.now() <= UtcDateTimeUtil.ofTimestamp( expiration ), f'JWT session token expired at {UtcDateTimeUtil.ofTimestamp(expiration)}' except Exception as exception: addAccessTokenToBlackList(rawJwt=decodedSessionToken) log.log(self.validateGeneralSessionAndReturnItDecoded, f'Adding {rawJwt} (or current accces) to blackList', exception=exception, muteStackTrace=True) raise exception return decodedSessionToken
def loadLocalConfiguration(self, loadLocalConfig, printRootPathStatus, globalsEverything): self.loadLocalConfig = loadLocalConfig self.localConfiguration = {} if self.loadLocalConfig: try: self.localConfiguration = self.getSettingTree( settingFilePath=Globals.LOCAL_CONFIGURATION_FILE_NAME, settingTree=None) except Exception as exception: self.log( f'Failed to load {Globals.LOCAL_CONFIGURATION_FILE_NAME} settings', exception=exception) keyQuery = SettingHelper.querySetting(AttributeKey.KW_KEY, self.localConfiguration) keyValueQuery = {} for key, value in keyQuery.items(): KW_DOT_KEY = f'{c.DOT}{AttributeKey.KW_KEY}' if key.endswith(KW_DOT_KEY): environmentInjection = SettingHelper.getSetting( key[:-len(KW_DOT_KEY)], self.localConfiguration) if (ObjectHelper.isDictionary(environmentInjection) and AttributeKey.KW_KEY in environmentInjection and AttributeKey.KW_VALUE in environmentInjection and 2 == len(environmentInjection)): EnvironmentHelper.update( environmentInjection[AttributeKey.KW_KEY], environmentInjection[AttributeKey.KW_VALUE]) log.loadSettings() self.printRootPathStatus = printRootPathStatus self.globalsEverything = globalsEverything self.ignoreModules = IGNORE_MODULES self.ignoreResources = IGNORE_REOURCES self.activeEnvironment = SettingHelper.getActiveEnvironment() if ObjectHelper.isNotEmpty( self.localConfiguration) and SettingHelper.getSetting( 'print-status', self.localConfiguration): SettingHelper.printSettings(self.localConfiguration, "Local Configuration") basicSettingsAsDictionary = { 'activeEnvironment': self.activeEnvironment, 'successStatus': self.successStatus, 'settingStatus': self.settingStatus, 'debugStatus': self.debugStatus, 'warningStatus': self.warningStatus, 'failureStatus': self.failureStatus, 'errorStatus': self.errorStatus, 'wrapperStatus': self.wrapperStatus, 'infoStatus': self.infoStatus, 'statusStatus': self.statusStatus, 'logStatus': self.logStatus, 'globalsEverything': self.globalsEverything, 'printRootPathStatus': self.printRootPathStatus } log.prettyPython(self.__class__, f'Basic settings', basicSettingsAsDictionary, logLevel=log.SETTING)
def getObjectAsDictionary(instance, fieldsToExpand=[EXPAND_ALL_FIELDS], visitedIdInstances=None): # print(instance) if ObjectHelper.isNone(visitedIdInstances): visitedIdInstances = [] if ObjectHelper.isNativeClassInstance(instance) or ObjectHelper.isNone(instance): return instance if EnumAnnotation.isEnumItem(instance): return instance.enumValue if isDatetimeRelated(instance): return str(instance) # print(f'{instance} not in {visitedIdInstances}: {instance not in visitedIdInstances}') isVisitedInstance = id(instance) in visitedIdInstances innerVisitedIdInstances = [*visitedIdInstances.copy()] if ObjectHelper.isDictionary(instance) and not isVisitedInstance : # for key,value in instance.items(): # instance[key] = getObjectAsDictionary(value, visitedIdInstances=innerVisitedIdInstances) # return instance return {key: getObjectAsDictionary(value, visitedIdInstances=innerVisitedIdInstances) for key, value in instance.items() } elif isSerializerCollection(instance): objectValueList = [] for innerObject in instance : innerAttributeValue = getObjectAsDictionary(innerObject, visitedIdInstances=innerVisitedIdInstances) if ObjectHelper.isNotNone(innerAttributeValue): objectValueList.append(innerAttributeValue) return objectValueList elif not isVisitedInstance : jsonInstance = {} try : # print(id(instance)) innerVisitedIdInstances.append(id(instance)) atributeNameList = getAttributeNameList_andPleaseSomeoneSlapTheFaceOfTheGuyWhoDidItInSqlAlchemy(instance.__class__) for attributeName in atributeNameList : attributeValue = getattr(instance, attributeName) if ReflectionHelper.isNotMethodInstance(attributeValue): jsonInstance[attributeName] = getObjectAsDictionary(attributeValue, visitedIdInstances=innerVisitedIdInstances) else : jsonInstance[attributeName] = None except Exception as exception : log.debug(getObjectAsDictionary, f'Not possible to get attribute name list from {ReflectionHelper.getName(ReflectionHelper.getClass(instance, muteLogs=True), muteLogs=True)}', exception=exception) if ObjectHelper.isNotEmpty(jsonInstance): return jsonInstance return str(instance)
def serializeIt(fromJson, toClass, fatherClass=None) : # print(f'fromJson: {fromJson}, toClass: {toClass}, fatherClass: {fatherClass}') if ObjectHelper.isDictionary(fromJson) and ObjectHelper.isDictionaryClass(toClass) : # objectInstance = {} # for key, value in fromJson.items() : # innerToClass = getTargetClassFromFatherClassAndChildMethodName(fatherClass, key) # objectInstance[key] = serializeIt(fromJson, innerToClass, fatherClass=fatherClass) # return objectInstance return fromJson # print() # print() # print(fromJson) # print(f'fromJson: {fromJson}') # print(f'toClass: {toClass}') if ObjectHelper.isNativeClassInstance(fromJson) and toClass == fromJson.__class__ : return fromJson attributeNameList = ReflectionHelper.getAttributeNameList(toClass) classRole = getClassRole(toClass) # print(f' classRole = {classRole}') # print(f' attributeNameList = {attributeNameList}') fromJsonToDictionary = {} for attributeName in attributeNameList : # print(f' fromJson.get({attributeName}) = {fromJson.get(attributeName)}') jsonAttributeValue = fromJson.get(attributeName) if ObjectHelper.isNone(jsonAttributeValue) : jsonAttributeValue = fromJson.get(f'{attributeName[0].upper()}{attributeName[1:].lower()}') if ObjectHelper.isNotNone(jsonAttributeValue) : # print(f'jsonAttributeValue: {jsonAttributeValue}') fromJsonToDictionary[attributeName] = resolveValue(jsonAttributeValue, attributeName, classRole, fatherClass=fatherClass) # logList = [ # f'jsonAttributeValue: {jsonAttributeValue}', # f'attributeName: {attributeName}', # f'classRole: {classRole}', # f'fromJsonToDictionary: {fromJsonToDictionary}', # f'toClass: {toClass}' # ] # log.prettyPython(serializeIt, 'logList', logList, logLevel=log.DEBUG) else : fromJsonToDictionary[attributeName] = jsonAttributeValue # if jsonAttributeValue : # ReflectionHelper.setAttributeOrMethod(fromObject, attributeName, jsonAttributeValue) args = [] kwargs = fromJsonToDictionary.copy() # print(f'fromJsonToDictionary = {fromJsonToDictionary}') objectInstance = None for key,value in fromJsonToDictionary.items() : # print(f'*args{args},**kwargs{kwargs}') try : objectInstance = toClass(*args,**kwargs) break except : args.append(value) del kwargs[key] # print(f'args = {args}, kwargs = {kwargs}') # print(f'args = {args}, kwargs = {kwargs}') if ObjectHelper.isNone(objectInstance) : raise Exception(f'Not possible to instanciate {ReflectionHelper.getName(toClass, muteLogs=True)} class') # print(objectInstance) # print() # print() # if objectInstance is [] : # print(fromJson, toClass, fatherClass) return objectInstance
def requestBodyIsPresent(requestBody) : return ObjectHelper.isNotNone(requestBody) and (ObjectHelper.isDictionary(requestBody) or ObjectHelper.isList(requestBody))
def myTest(): inBetweenTestEnvironmentSettings = EnvironmentHelper.getSet() assert ObjectHelper.isNotNone(inBetweenTestEnvironmentSettings) assert ObjectHelper.isDictionary(inBetweenTestEnvironmentSettings) assert 'a' == myFunction('a') return inBetweenTestEnvironmentSettings
def basicMethods(): # arrange def generatorInstance(): while True: yield False break STR_INSTANCE = str() BOOLEAN_INSTANCE = bool() INTEGER_INSTANCE = int() FLOAT_INSTANCE = float() DICTIONARY_INSTANCE = dict() LIST_INSTANCE = list() TUPLE_INSTANCE = tuple() SET_INSTANCE = set() GENERATOR_INSTANCE = generatorInstance() STR_FILLED_INSTANCE = 'str()' BOOLEAN_FILLED_INSTANCE = True INTEGER_FILLED_INSTANCE = 2 FLOAT_FILLED_INSTANCE = 3.3 DICTIONARY_FILLED_INSTANCE = {'dict()': dict()} LIST_FILLED_INSTANCE = [list(), list()] TUPLE_FILLED_INSTANCE = (tuple(), tuple()) SET_FILLED_INSTANCE = {'set()', 2} # act # assert assert ObjectHelper.isNotNone(STR_INSTANCE) assert ObjectHelper.isNotNone(BOOLEAN_INSTANCE) assert ObjectHelper.isNotNone(INTEGER_INSTANCE) assert ObjectHelper.isNotNone(FLOAT_INSTANCE) assert ObjectHelper.isNotNone(DICTIONARY_INSTANCE) assert ObjectHelper.isNotNone(LIST_INSTANCE) assert ObjectHelper.isNotNone(TUPLE_INSTANCE) assert ObjectHelper.isNotNone(SET_INSTANCE) assert ObjectHelper.isNotNone(GENERATOR_INSTANCE) assert ObjectHelper.isNotNone(STR_FILLED_INSTANCE) assert ObjectHelper.isNotNone(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotNone(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotNone(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotNone(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotNone(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotNone(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotNone(SET_FILLED_INSTANCE) assert not ObjectHelper.isNone(STR_FILLED_INSTANCE) assert not ObjectHelper.isNone(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isNone(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isNone(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isNone(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isNone(LIST_FILLED_INSTANCE) assert not ObjectHelper.isNone(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isNone(SET_FILLED_INSTANCE) assert not ObjectHelper.isNone(GENERATOR_INSTANCE) assert not ObjectHelper.isList(STR_FILLED_INSTANCE) assert not ObjectHelper.isList(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isList(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isList(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isList(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isList(LIST_FILLED_INSTANCE) assert not ObjectHelper.isList(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isList(SET_FILLED_INSTANCE) assert not ObjectHelper.isList(GENERATOR_INSTANCE) assert ObjectHelper.isNotList(STR_FILLED_INSTANCE) assert ObjectHelper.isNotList(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotList(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotList(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotList(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isNotList(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotList(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotList(SET_FILLED_INSTANCE) assert ObjectHelper.isNotList(GENERATOR_INSTANCE) assert not ObjectHelper.isSet(STR_FILLED_INSTANCE) assert not ObjectHelper.isSet(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isSet(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isSet(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isSet(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isSet(LIST_FILLED_INSTANCE) assert not ObjectHelper.isSet(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isSet(SET_FILLED_INSTANCE) assert not ObjectHelper.isSet(GENERATOR_INSTANCE) assert ObjectHelper.isNotSet(STR_FILLED_INSTANCE) assert ObjectHelper.isNotSet(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotSet(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotSet(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotSet(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotSet(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotSet(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isNotSet(SET_FILLED_INSTANCE) assert ObjectHelper.isNotSet(GENERATOR_INSTANCE) assert not ObjectHelper.isTuple(STR_FILLED_INSTANCE) assert not ObjectHelper.isTuple(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isTuple(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isTuple(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isTuple(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isTuple(LIST_FILLED_INSTANCE) assert ObjectHelper.isTuple(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isTuple(SET_FILLED_INSTANCE) assert not ObjectHelper.isTuple(GENERATOR_INSTANCE) assert ObjectHelper.isNotTuple(STR_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(LIST_FILLED_INSTANCE) assert not ObjectHelper.isNotTuple(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(SET_FILLED_INSTANCE) assert ObjectHelper.isNotTuple(GENERATOR_INSTANCE) assert not ObjectHelper.isDictionary(STR_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isDictionary(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(LIST_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(SET_FILLED_INSTANCE) assert not ObjectHelper.isDictionary(GENERATOR_INSTANCE) assert ObjectHelper.isNotDictionary(STR_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isNotDictionary(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(SET_FILLED_INSTANCE) assert ObjectHelper.isNotDictionary(GENERATOR_INSTANCE) assert not ObjectHelper.isCollection(STR_FILLED_INSTANCE) assert not ObjectHelper.isCollection(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isCollection(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isCollection(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isCollection(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isCollection(LIST_FILLED_INSTANCE) assert ObjectHelper.isCollection(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isCollection(SET_FILLED_INSTANCE) assert not ObjectHelper.isCollection(GENERATOR_INSTANCE) assert ObjectHelper.isNotCollection(STR_FILLED_INSTANCE) assert ObjectHelper.isNotCollection(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotCollection(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotCollection(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isNotCollection(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isNotCollection(LIST_FILLED_INSTANCE) assert not ObjectHelper.isNotCollection(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isNotCollection(SET_FILLED_INSTANCE) assert ObjectHelper.isNotCollection(GENERATOR_INSTANCE) assert not ObjectHelper.isDictionaryClass(STR_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(LIST_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(SET_FILLED_INSTANCE) assert not ObjectHelper.isDictionaryClass(GENERATOR_INSTANCE) assert ObjectHelper.isNotDictionaryClass(STR_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(SET_FILLED_INSTANCE) assert ObjectHelper.isNotDictionaryClass(GENERATOR_INSTANCE) assert not ObjectHelper.isDictionaryClass(type(STR_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(BOOLEAN_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(INTEGER_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(FLOAT_FILLED_INSTANCE)) assert ObjectHelper.isDictionaryClass(type(DICTIONARY_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(LIST_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(TUPLE_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(SET_FILLED_INSTANCE)) assert not ObjectHelper.isDictionaryClass(type(GENERATOR_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(STR_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(BOOLEAN_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(INTEGER_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(FLOAT_FILLED_INSTANCE)) assert not ObjectHelper.isNotDictionaryClass( type(DICTIONARY_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(LIST_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(TUPLE_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(SET_FILLED_INSTANCE)) assert ObjectHelper.isNotDictionaryClass(type(GENERATOR_INSTANCE)) assert ObjectHelper.isNativeClass(type(STR_FILLED_INSTANCE)) assert ObjectHelper.isNativeClass(type(BOOLEAN_FILLED_INSTANCE)) assert ObjectHelper.isNativeClass(type(INTEGER_FILLED_INSTANCE)) assert ObjectHelper.isNativeClass(type(FLOAT_FILLED_INSTANCE)) assert not ObjectHelper.isNativeClass(type(DICTIONARY_FILLED_INSTANCE)) assert not ObjectHelper.isNativeClass(type(LIST_FILLED_INSTANCE)) assert not ObjectHelper.isNativeClass(type(TUPLE_FILLED_INSTANCE)) assert not ObjectHelper.isNativeClass(type(SET_FILLED_INSTANCE)) assert ObjectHelper.isNativeClass(type(GENERATOR_INSTANCE)) assert not ObjectHelper.isNotNativeClass(type(STR_FILLED_INSTANCE)) assert not ObjectHelper.isNotNativeClass(type(BOOLEAN_FILLED_INSTANCE)) assert not ObjectHelper.isNotNativeClass(type(INTEGER_FILLED_INSTANCE)) assert not ObjectHelper.isNotNativeClass(type(FLOAT_FILLED_INSTANCE)) assert ObjectHelper.isNotNativeClass(type(DICTIONARY_FILLED_INSTANCE)) assert ObjectHelper.isNotNativeClass(type(LIST_FILLED_INSTANCE)) assert ObjectHelper.isNotNativeClass(type(TUPLE_FILLED_INSTANCE)) assert ObjectHelper.isNotNativeClass(type(SET_FILLED_INSTANCE)) assert not ObjectHelper.isNotNativeClass(type(GENERATOR_INSTANCE)) assert ObjectHelper.isNativeClassInstance(STR_FILLED_INSTANCE) assert ObjectHelper.isNativeClassInstance(BOOLEAN_FILLED_INSTANCE) assert ObjectHelper.isNativeClassInstance(INTEGER_FILLED_INSTANCE) assert ObjectHelper.isNativeClassInstance(FLOAT_FILLED_INSTANCE) assert not ObjectHelper.isNativeClassInstance(DICTIONARY_FILLED_INSTANCE) assert not ObjectHelper.isNativeClassInstance(LIST_FILLED_INSTANCE) assert not ObjectHelper.isNativeClassInstance(TUPLE_FILLED_INSTANCE) assert not ObjectHelper.isNativeClassInstance(SET_FILLED_INSTANCE) assert ObjectHelper.isNativeClassInstance(GENERATOR_INSTANCE) assert not ObjectHelper.isNotNativeClassIsntance(STR_FILLED_INSTANCE) assert not ObjectHelper.isNotNativeClassIsntance(BOOLEAN_FILLED_INSTANCE) assert not ObjectHelper.isNotNativeClassIsntance(INTEGER_FILLED_INSTANCE) assert not ObjectHelper.isNotNativeClassIsntance(FLOAT_FILLED_INSTANCE) assert ObjectHelper.isNotNativeClassIsntance(DICTIONARY_FILLED_INSTANCE) assert ObjectHelper.isNotNativeClassIsntance(LIST_FILLED_INSTANCE) assert ObjectHelper.isNotNativeClassIsntance(TUPLE_FILLED_INSTANCE) assert ObjectHelper.isNotNativeClassIsntance(SET_FILLED_INSTANCE) assert not ObjectHelper.isNotNativeClassIsntance(GENERATOR_INSTANCE) assert ObjectHelper.isNone(None) assert not ObjectHelper.isNotNone(None) assert not ObjectHelper.isList(None) assert ObjectHelper.isNotList(None) assert not ObjectHelper.isSet(None) assert ObjectHelper.isNotSet(None) assert not ObjectHelper.isTuple(None) assert ObjectHelper.isNotTuple(None) assert not ObjectHelper.isDictionary(None) assert ObjectHelper.isNotDictionary(None) assert not ObjectHelper.isCollection(None) assert ObjectHelper.isNotCollection(None) assert not ObjectHelper.isDictionaryClass(None) assert ObjectHelper.isNotDictionaryClass(None) assert not ObjectHelper.isNativeClass(None) assert ObjectHelper.isNotNativeClass(None) assert not ObjectHelper.isNativeClassInstance(None) assert ObjectHelper.isNotNativeClassIsntance(None) assert not ObjectHelper.isNone(type(None)) assert ObjectHelper.isNotNone(type(None)) assert not ObjectHelper.isList(type(None)) assert ObjectHelper.isNotList(type(None)) assert not ObjectHelper.isDictionary(type(None)) assert ObjectHelper.isNotDictionary(type(None)) assert not ObjectHelper.isCollection(type(None)) assert ObjectHelper.isNotCollection(type(None)) assert not ObjectHelper.isDictionaryClass(type(None)) assert ObjectHelper.isNotDictionaryClass(type(None)) assert not ObjectHelper.isNativeClass(type(None)) assert ObjectHelper.isNotNativeClass(type(None)) assert not ObjectHelper.isNativeClassInstance(type(None)) assert ObjectHelper.isNotNativeClassIsntance(type(None))