def test_with_invalid_input(self): """We error with incorrect dataset_type""" for dataset_type in ['ruler', 'pencil', 'cheese']: with self.assertRaises(ValueError) as exc: check_dataset_type(dataset_type) self.assertEqual("Dataset type not 'regular' or 'raw' is %s" % dataset_type, str(exc.exception))
def test_with_valid_input(self): """We match when the input is what we expect it to be""" for dataset_type in ['regular', 'raw', 'REGULAR', 'RAW']: try: check_dataset_type(dataset_type) except ValueError: self.fail("Dataset {0} should be valid".format(dataset_type))
def test_with_valid_input(self): """We match when the input is what we expect it to be""" for dataset_type in ['regular', 'raw', 'REGULAR', 'RAW']: try: check_dataset_type(dataset_type) except ValueError: self.fail("Dataset {0} should be valid".format(dataset_type))
def test_with_invalid_input(self): """We error with incorrect dataset_type""" for dataset_type in ['ruler', 'pencil', 'cheese']: with self.assertRaises(ValueError) as exc: check_dataset_type(dataset_type) self.assertEqual( "Dataset type not 'regular' or 'raw' is %s" % dataset_type, str(exc.exception))