def test_poor_cases(self): """Bad formats for check_dataset_format""" for nonsense in ['xls', 'dat', 'xslx']: with self.assertRaises(ValueError) as exc: check_dataset_format(nonsense) self.assertEqual("dataset_format is expected to be one of " "%s. '%s' is not valid" % (', '.join(DATASET_FORMATS.keys()), nonsense), str(exc.exception))
def test_good_cases(self): """Good happy case for check_dataset_format""" try: check_dataset_format("CSV") check_dataset_format("XML") check_dataset_format("csv") check_dataset_format("xml") except ValueError: self.fail()