def ignore_test_should_understand_redirects_to_external_targets(self): web = Web() moodle = Moodle(web) username = "" password = "" moodle.login(username, password) paeps = [ course for course in moodle.my_courses() if u"dagogische Psychologie" in course.name ].pop() materials = moodle.material_page_for(paeps.id) links = materials.find_links_in_content(materials.markup) for link in links: resource = Resource(link.getText(), link.get('href'), web, "http://elearning.uni-heidelberg.de/mod/resource/") response = web.head(resource.url) print resource.name print resource.url print response.getcode()
def ignore_test_should_do_a_head_request(self): #Arrange url = "http://localhost:5000/" # run serve.py to run this server # System under Test web = Web() # Act response = web.head(url) # Assert contentType = response.headers["Content-Type"] self.assertIn("text/html", contentType) content = response.read() self.assertEqual(content, "")