Ejemplo n.º 1
0
 def test_year_parity_restrictions(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.year_parity_restrictions(
             YearParityRestrictions.EVEN_YEARS)
     except Exception:
         self.fail()
Ejemplo n.º 2
0
 def test_restrictions_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.restrictions(1234)
     with self.assertRaises(Exception):
         CourseVal.restrictions([1234])
     with self.assertRaises(Exception):
         CourseVal.restrictions([""])
     with self.assertRaises(Exception):
         CourseVal.restrictions([])
Ejemplo n.º 3
0
 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([""])
Ejemplo n.º 4
0
 def test_lab_hours_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.lab_hours("3.14")
     with self.assertRaises(Exception):
         CourseVal.lab_hours(-3.14)
     with self.assertRaises(Exception):
         CourseVal.lab_hours(float(24*8))
Ejemplo n.º 5
0
 def test_semesters_offered_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.semesters_offered(1234)
     with self.assertRaises(Exception):
         CourseVal.semesters_offered([1234])
     with self.assertRaises(Exception):
         CourseVal.semesters_offered([""])
Ejemplo n.º 6
0
 def test_prerequisites(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.prerequisites({
             "simple": ["test"],
             "complex": ["test"],
             "original": "test"
         })
         CourseVal.prerequisites({
             "simple": ["test"],
             "original": "test"
         })
         CourseVal.prerequisites({
             "complex": ["test"],
             "original": "test"
         })
     except Exception:
         self.fail()
Ejemplo n.º 7
0
 def test_capacity_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.capacity("1234")
     with self.assertRaises(Exception):
         CourseVal.capacity(-1234)
Ejemplo n.º 8
0
 def test_subject_invalid_type(self):
     """ Test that non-string subject raises exception """
     with self.assertRaises(Exception):
         CourseVal.subject(1234)
Ejemplo n.º 9
0
 def test_capacity(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.capacity(1234)
     except Exception:
         self.fail()
Ejemplo n.º 10
0
 def test_corequisites_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.corequisites("")
Ejemplo n.º 11
0
 def test_restrictions(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.restrictions(["test"])
     except Exception:
         self.fail()
Ejemplo n.º 12
0
 def test_distance_education(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.distance_education(DistanceEducation.NO)
     except Exception:
         self.fail()
Ejemplo n.º 13
0
 def test_corequisites_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.corequisites(1234)
Ejemplo n.º 14
0
 def test_name(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.name("test")
     except Exception:
         self.fail()
Ejemplo n.º 15
0
 def test_name_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.name(1234)
Ejemplo n.º 16
0
 def test_subject_length(self):
     """ Test that zero-length subject raises exception """
     with self.assertRaises(Exception):
         CourseVal.subject("")
Ejemplo n.º 17
0
 def test_number(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.number("1234")
     except Exception:
         self.fail()
Ejemplo n.º 18
0
 def test_year_parity_restrictions_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.year_parity_restrictions(1234)
Ejemplo n.º 19
0
 def test_credits_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.credits("0.5")
     with self.assertRaises(Exception):
         CourseVal.credits(-0.5)
Ejemplo n.º 20
0
 def test_distance_education_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.distance_education(1234)
Ejemplo n.º 21
0
 def test_credits(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.credits(0.5)
     except Exception:
         self.fail()
Ejemplo n.º 22
0
 def test_lab_hours(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.lab_hours(3.14)
     except Exception:
         self.fail()
Ejemplo n.º 23
0
 def test_departments_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.departments([])
Ejemplo n.º 24
0
 def test_description(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.description("test")
     except Exception:
         self.fail()
Ejemplo n.º 25
0
 def test_number_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.number("")
     with self.assertRaises(Exception):
         CourseVal.number("12345")
Ejemplo n.º 26
0
 def test_prerequisites_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.prerequisites("test")
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "test"})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"simple": ["test"]})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": 1234, "simple": ["test"]})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "", "simple": ["test"]})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "test", "simple": 1234})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "test", "simple": []})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "test", "complex": 1234})
     with self.assertRaises(Exception):
         CourseVal.prerequisites({"original": "test", "complex": []})
Ejemplo n.º 27
0
 def test_subject(self):
     """ Test that valid subject does not raise exception """
     try:
         CourseVal.subject("test")
     except Exception:
         self.fail()
Ejemplo n.º 28
0
 def test_departments(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.departments(["test"])
     except Exception:
         self.fail()
Ejemplo n.º 29
0
 def test_name_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.name("")
Ejemplo n.º 30
0
 def test_corequisites(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.corequisites("test")
     except Exception:
         self.fail()