Exemple #1
0
	def testAuthGenerationMultiple(self):
		response = '[{"year": "2015", "institution": "UC Soumya", "url": "https://ok-server.appspot.com/#/course/5066549580791808", "display_name": "CS 61A", "term": "spring"}, \
				{"year": "2014", "institution": "UC Soumya", "url": "https://ok-server.appspot.com/#/course/5066549580791808", "display_name": "CS 61B", "term": "spring"}, \
				{"year": "2013", "institution": "UC Soumya", "url": "https://ok-server.appspot.com/#/course/5066549580791808", "display_name": "CS 61C", "term": "spring"}]'
		html = success_auth(success_courses(response, 'http://localhost:8080'))
		self.assertNotEqual(-1, html.find('Ok!'))
		self.assertNotEqual(-1, html.find('and are currently enrolled'))
		self.assertNotEqual(-1, html.find('3 courses'))
Exemple #2
0
	def testAuthColorChange(self):
		response = '[]'
		html = success_auth(success_courses(response, 'http://localhost:8080'))
		self.assertNotEqual(-1, html.find('<style>'))
Exemple #3
0
	def testAuthEmptyGeneration(self):
		response = '[]'
		html = success_auth(success_courses(response, 'http://localhost:8080'))
		self.assertNotEqual(-1, html.find('Uh oh'))
		self.assertNotEqual(-1, html.find(', but'))
		self.assertNotEqual(-1, html.find('No courses'))