def test_departments_invalid_type(self): """ Test that invalid type raises exception """ with self.assertRaises(Exception): CourseVal.departments(1234) with self.assertRaises(Exception): CourseVal.departments([1234]) with self.assertRaises(Exception): CourseVal.departments([""])
def test_departments_length(self): """ Test that zero-length raises exception """ with self.assertRaises(Exception): CourseVal.departments([])
def test_departments(self): """ Test that valid args does not raise exception """ try: CourseVal.departments(["test"]) except Exception: self.fail()