Wireless-Innovation-Forum / Citizens-Broadband-Radio-Service-Device

Apache License 2.0
32 stars 19 forks source link

Mock-SASv2.1: The function "def isThereMoreThenOneValueInside(self,value):" in Assert.py is not working properly #18

Closed ericzh31ericsson closed 7 years ago

ericzh31ericsson commented 7 years ago

In Mock-SASv2.1, the function "def isThereMoreThenOneValueInside(self,value):" in Assert.py is not working when determine if there are multiple values in the parameters. especially when in the case of {"$or":["A","B"]}, or " {"$or":[["A"],["B"]]}. It gave the failure.

I just made some work around to modify code as below:

    if("$or" in str(value)):
        strValue = str(value)            
        #print strValue

        indexOfOr= strValue.index("$or") 
        if indexOfOr <= 14
            return False

The idea here is that when '$or" is in the beginning of whole
json object, then treat it as no multiple values inside. -- Of course this is just a workaround, please provide comments for more good solution.

awaizkhan commented 7 years ago

Fixed in V3.

ericzh31ericsson commented 7 years ago

The issue is not fixed, Closed this one and open a new issue for Mock-SAS v3.0