def test_create_csv_report(self): with open('temperature_site.html', 'r') as temp_file: content = temp_file.read() units_reports = UpdateLogSiteParser().parse_to_unit_reports(content) reports = FukushimaSiteReports() reports.unit_reports = {'042211' : units_reports} (header, csv_line) = reports.to_csv().split('\n') self.assertEqual(header, 'date;feedwater_nozzle_temp_unit_1;feedwater_nozzle_temp_unit_2;feedwater_nozzle_temp_unit_3;reactor_bottom_temp_unit_1;reactor_bottom_temp_unit_2;reactor_bottom_temp_unit_3') self.assertEqual(csv_line, '22/04/11;138;123;75;111;-1;111')
def xtest_live_fetch_first_site_and_all_depending(self): report_handler = FukushimaSiteReports() report_handler.update_from_update_sites('http://www.iaea.org/newscenter/news/tsunamiupdate01.html') print report_handler.to_csv()