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 test_should_return_all_resources_on_the_test_page(self): moodle = Moodle(web=self.web) course = 6704 page = moodle.material_page_for(course) materials = page.resources() self.assertEqual(len(materials), 8)