Beispiel #1
0
def get_performance_report_blob_key(state, district, block, month,
                                    file_format):
    key_safe_date = datetime.strptime(month, '%B %Y').strftime('%Y_%m')
    key = 'performance_report-{}-{}-{}-{}-{}'.format(state, district, block,
                                                     key_safe_date,
                                                     file_format)
    safe_key = key.replace(' ', '_')
    return safe_id(safe_key)
Beispiel #2
0
def test_safe_id(self, value, result):
    if isinstance(result, type):
        with self.assertRaises(result):
            mod.safe_id(value)
    else:
        self.assertEqual(mod.safe_id(value), result)
Beispiel #3
0
def test_safe_id(self, value, result):
    if isinstance(result, type):
        with self.assertRaises(result):
            mod.safe_id(value)
    else:
        self.assertEqual(mod.safe_id(value), result)