def test_get_errored_distributions(self):
        parse_catalog('test_catalog',
                      os.path.join(SAMPLES_DIR, 'test_catalog.json'))
        Distribution.objects.filter(dataset__catalog__identifier='test_catalog'). \
            update(error=True, error_msg="Error!")

        self.assertEqual(
            DistributionRepository.get_all_errored().first().error_msg,
            "Error!")
Пример #2
0
    def test_get_errored_distributions_is_empty_if_all_ok(self):
        parse_catalog('test_catalog', os.path.join(SAMPLES_DIR, 'test_catalog.json'))

        self.assertFalse(DistributionRepository.get_all_errored())
Пример #3
0
 def test_read_csv_as_dataframe(self):
     parse_catalog('test_catalog', os.path.join(SAMPLES_DIR, 'test_catalog.json'))
     distribution = Distribution.objects.last()
     df = DistributionRepository(distribution).read_csv_as_time_series_dataframe()
     self.assertTrue(list(df.columns))