def test_lstring(userid, state): try: conversation.sequence_d(userid, state, "hello world! I am a programmer from hkust and major in computer science! This is my final year project test part!") except Exception as e: print("error when test long string, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "hello world! I am a programmer from hkust and major in computer science! This is my final year project test part!") except Exception as e: print("error when test long string, employment!" + str(userid) + "!!" + str(state)) print(e)
def test_nfloat(userid, state): try: conversation.sequence_d(userid, state, "-0.5") except Exception as e: print("error when test negative float, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "-0.5") except Exception as e: print("error when test negative float, employment!" + str(userid) + "!!" + str(state)) print(e)
def test_string(userid, state): try: conversation.sequence_d(userid, state, "hello world") except Exception as e: print("error when test string, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "hello world") except Exception as e: print("error when test string, employment!" + str(userid) + "!!" + str(state)) print(e)
def test_lfloat(userid, state): try: conversation.sequence_d(userid, state, "999999999.9999999999") except Exception as e: print("error when test large float, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "999999999.9999999999") except Exception as e: print("error when test large float, employment!" + str(userid) + "!!" + str(state)) print(e)
def test_lint(userid, state): try: conversation.sequence_d(userid, state, "10000000") except Exception as e: print("error when test large integer, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "10000000") except Exception as e: print("error when test large integer, employment!" + str(userid) + "!!" + str(state)) print(e)
def test_special(userid, state): try: conversation.sequence_d(userid, state, "$%@#") except Exception as e: print("error when test special character, divorce!" + str(userid) + "!!" + str(state)) print(e) try: conversation.sequence_e(userid, state, "$%@#") except Exception as e: print("error when test special character, employment!" + str(userid) + "!!" + str(state)) print(e)
test_lint(userid,i) test_lfloat(userid,i) test_string(userid,i) test_lstring(userid,i) test_nint(userid,i) test_nfloat(userid,i) test_special(userid,i) employment_data = read_employment() divorce_data = read_divorce() for i in range(len(employment_data)): for j in range(1,len(employment_data[0])): try: conversation.sequence_e(userid, j, employment_data[i][j-1]) except Exception as e: print(e) for i in range(len(divorce_data)): for j in range(1,len(divorce_data[0])): try: conversation.sequence_d(userid, j, divorce_data[i][j-1]) except Exception as e: print(e)