예제 #1
0
파일: Tests.py 프로젝트: stensaethf/Xword
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 \
예제 #2
0
파일: Tests.py 프로젝트: stensaethf/Xword
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 \
예제 #3
0
파일: Tests.py 프로젝트: stensaethf/Xword
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 \
예제 #4
0
파일: Tests.py 프로젝트: stensaethf/Xword
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 \
예제 #5
0
파일: Tests.py 프로젝트: stensaethf/Xword
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 \
예제 #6
0
파일: Tests.py 프로젝트: stensaethf/Xword
def testGetAssociatedWordsForDefinitionShouldReturnListOfWords():
	returnedTest5 = test_db.getAssociatedWords('Definition','Food')

	if not (isinstance(returnedTest5,list)):
		print "Returned object for Defination not a list of strings"
예제 #7
0
파일: Tests.py 프로젝트: stensaethf/Xword
def testGetAssociatedWordsForAdverbShouldReturnListOfWords():
	returnedTest4 = test_db.getAssociatedWords('Adverb','Food')

	if not (isinstance(returnedTest4,list)):
		print "Returned object for Adverb not a list"
예제 #8
0
파일: Tests.py 프로젝트: stensaethf/Xword
def testGetAssociatedWordsForAdjectiveShouldReturnListOfWords():	
	returnedTest2 = test_db.getAssociatedWords('Adjective','Food')

	if not (isinstance(returnedTest2,list)):
		print "Returned object for Adjective not a list"
예제 #9
0
파일: Tests.py 프로젝트: stensaethf/Xword
def testGetAssociatedWordsForNounShouldReturnListOfWords():
	returnedTest1 = test_db.getAssociatedWords('Noun','Food')

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