Beispiel #1
0
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 \
Beispiel #2
0
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 \
Beispiel #3
0
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 \
Beispiel #4
0
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 \
Beispiel #5
0
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 \
Beispiel #6
0
def testGetAssociatedWordsForDefinitionShouldReturnListOfWords():
	returnedTest5 = test_db.getAssociatedWords('Definition','Food')

	if not (isinstance(returnedTest5,list)):
		print "Returned object for Defination not a list of strings"
Beispiel #7
0
def testGetAssociatedWordsForAdverbShouldReturnListOfWords():
	returnedTest4 = test_db.getAssociatedWords('Adverb','Food')

	if not (isinstance(returnedTest4,list)):
		print "Returned object for Adverb not a list"
Beispiel #8
0
def testGetAssociatedWordsForAdjectiveShouldReturnListOfWords():	
	returnedTest2 = test_db.getAssociatedWords('Adjective','Food')

	if not (isinstance(returnedTest2,list)):
		print "Returned object for Adjective not a list"
Beispiel #9
0
def testGetAssociatedWordsForNounShouldReturnListOfWords():
	returnedTest1 = test_db.getAssociatedWords('Noun','Food')

	if not (isinstance(returnedTest1,list)):
		print "Returned object for Noun not a list"