Exemple #1
0
    def test_road_report_template(self):
        """Test Road Report Template."""
        with open(ROAD_JSON_FILE) as json_file:
            impact_data = json.load(json_file)

        road_report_template = GenericReportTemplate(impact_data=impact_data)
        report = road_report_template.generate_message_report()
        self.assertIn(impact_data['question'], report.message[0].to_text())

        expected = '''
---
**17459.7365945**, 41,116, 58,576---
'''
        result = report.message[1].to_text()
        self.assertIn(expected, result)
    def test_road_report_template(self):
        """Test Road Report Template."""
        with open(ROAD_JSON_FILE) as json_file:
            impact_data = json.load(json_file)

        road_report_template = GenericReportTemplate(
            impact_data=impact_data)
        report = road_report_template.generate_message_report()
        self.assertIn(
            impact_data['question'], report.message[0].to_text())

        expected = '''
---
**17459.7365945**, 41,116, 58,576---
'''
        result = report.message[1].to_text()
        self.assertIn(expected, result)
Exemple #3
0
    def test_building_report_template(self):
        """Test Building Report Template."""
        with open(BUILDING_JSON_FILE) as json_file:
            impact_data = json.load(json_file)

        building_report_template = GenericReportTemplate(
            impact_data=impact_data)
        report = building_report_template.generate_message_report()
        self.assertIn(impact_data['question'], report.message[0].to_text())
        text = '''
---
**High**, 0------
**Medium**, 181------
**Low**, 0------
**Affected buildings**, 181------
**Not affected buildings**, 0------
**Total**, 181---
'''

        self.assertIn(text, report.message[1].to_text())
    def test_building_report_template(self):
        """Test Building Report Template."""
        with open(BUILDING_JSON_FILE) as json_file:
            impact_data = json.load(json_file)

        building_report_template = GenericReportTemplate(
            impact_data=impact_data)
        report = building_report_template.generate_message_report()
        self.assertIn(
            impact_data['question'], report.message[0].to_text())
        text = '''
---
**High**, 0------
**Medium**, 181------
**Low**, 0------
**Affected buildings**, 181------
**Not affected buildings**, 0------
**Total**, 181---
'''

        self.assertIn(text, report.message[1].to_text())