def testGetAssociatedWordsWithSpaceShouldReturnEmptyList(): #illegal : putting space as type_category returnedShouldFail = test_db.getAssociatedWords(' ','Food') if not (isinstance(returnedShouldFail,list)): print "Returned object for type_category = ' ' not a list" if returnedShouldFail != ['Invalid category']: print "Returned a none empty list for the input \
def testGetAssociatedWordsWithoutBothInputsShouldReturnEmptyList(): #illegal: testing for null input for both inputs returnedShouldFail = test_db.getAssociatedWords('','') if not (isinstance(returnedShouldFail,list)): print "Returned object for type_category = ' ' not a list" if returnedShouldFail != []: print "Returned a none empty list for the input \
def testGetAssociatedWordsWithWordAsIllegalCharactersShouldReturnEmptyList(): #illegal: testing for word = <illegal characters> returnedShouldFail = test_db.getAssociatedWords('Noun','~!@#$%^&*()_+') if not (isinstance(returnedShouldFail,list)): print "Returned object for word = <illegal characters> not a list" if returnedShouldFail != ['']: print "Returned a none empty list for the input \
def testGetAssociatedWordsWithIllegalCharactersShouldReturnEmptyList(): #illegal : putting illegal characters as type_category returnedShouldFail = test_db.getAssociatedWords('!@$#%&^%*()_~^','Food') if not (isinstance(returnedShouldFail,list)): print "Returned object for 'type_category = illegal characters' not a list" if returnedShouldFail != ['Invalid category']: print "Returned a none empty list for the input \
def testGetAssociatedWordsWithWordAsNothingShouldReturnEmptyList(): #illegal: testing for word = '' returnedShouldFail = test_db.getAssociatedWords('Noun','') if not (isinstance(returnedShouldFail,list)): print "Returned object for word = '' not a list" if returnedShouldFail != []: print "Returned a none empty list for the input \
def testGetAssociatedWordsForDefinitionShouldReturnListOfWords(): returnedTest5 = test_db.getAssociatedWords('Definition','Food') if not (isinstance(returnedTest5,list)): print "Returned object for Defination not a list of strings"
def testGetAssociatedWordsForAdverbShouldReturnListOfWords(): returnedTest4 = test_db.getAssociatedWords('Adverb','Food') if not (isinstance(returnedTest4,list)): print "Returned object for Adverb not a list"
def testGetAssociatedWordsForAdjectiveShouldReturnListOfWords(): returnedTest2 = test_db.getAssociatedWords('Adjective','Food') if not (isinstance(returnedTest2,list)): print "Returned object for Adjective not a list"
def testGetAssociatedWordsForNounShouldReturnListOfWords(): returnedTest1 = test_db.getAssociatedWords('Noun','Food') if not (isinstance(returnedTest1,list)): print "Returned object for Noun not a list"