Skip to content

Commit

Permalink
Merge pull request #150 from madgik/dev_checkalgorithmparameters
Browse files Browse the repository at this point in the history
Dev checkalgorithmparameters
  • Loading branch information
ezacharia authored Oct 14, 2019
2 parents 686f998 + 20a7256 commit 74ee57a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def privacychecking(*args):
def categoricalparameter_inputerrorchecking(parameterName, parameterVal, domainVals):
values = re.split(',',domainVals)
if str(parameterVal) not in values:
raise functions.OperatorError("ExaremeError", "Incorrect parameter value. " + parameterName + "'value should be one of the following: " + domainVals)
raise functions.OperatorError("ExaremeError", "Incorrect parameter value. '" + parameterName + "' value should be one of the following: " + domainVals)
return "OK"
categoricalparameter_inputerrorchecking.registered = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

endpointUrl='http://88.197.53.23:9090/mining/query/ANOVA'

def test_Histogram_Privacy():
def test_ANOVA_Privacy():
logging.info("---------- TEST : Algorithms for Privacy Error")
data = [{ "name": "iterations_max_number", "value": "20" },
{ "name": "x", "value": "ANOVA_var_I1*ANOVA_var_I2*ANOVA_var_I3" },
Expand All @@ -23,4 +23,4 @@ def test_Histogram_Privacy():


def check_privacy_result(result):
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. sstype'value should be one of the following: 1,2,3 \",\"type\":\"text/plain+user_error\"}]}"
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. \'sstype\' value should be one of the following: 1,2,3 \",\"type\":\"text/plain+user_error\"}]}"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

endpointUrl='http://88.197.53.23:9090/mining/query/LINEAR_REGRESSION'

def test_Histogram_Privacy():
def test_LINEAR_REGRESSION_Privacy():
logging.info("---------- TEST : Algorithms for Privacy Error")
data = [{ "name": "x", "value": "alzheimerbroadcategory+gender"},
{ "name": "y", "value": "lefthippocampus"},
Expand All @@ -22,6 +22,6 @@ def test_Histogram_Privacy():


def check_privacy_result(result):
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. encodingparameter\'value should be one of the following: dummycoding,sumscoding,simplecoding \",\"type\":\"text/plain+user_error\"}]}"
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. \'encodingparameter\' value should be one of the following: dummycoding,sumscoding,simplecoding \",\"type\":\"text/plain+user_error\"}]}"
if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

endpointUrl='http://88.197.53.100:9090/mining/query/TTEST_ONESAMPLE'

def test_Histogram_Privacy():
def test_TTEST_ONESAMPLE_Privacy():
logging.info("---------- TEST : Algorithms for Privacy Error")
data = [{"name": "y", "value": "lefthippocampus,righthippocampus"},
{"name": "testvalue", "value": "3.0" },
Expand All @@ -25,7 +25,7 @@ def test_Histogram_Privacy():


def check_privacy_result(result):
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. ci\'value should be one of the following: 0,1 \",\"type\":\"text/plain+user_error\"}]}"
assert result == "{\"result\" : [{\"data\":\" Incorrect parameter value. \'ci\' value should be one of the following: 0,1 \",\"type\":\"text/plain+user_error\"}]}"

if __name__ == '__main__':
unittest.main()

0 comments on commit 74ee57a

Please sign in to comment.