Beispiel #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()
Beispiel #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([])
Beispiel #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([""])
Beispiel #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))
Beispiel #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([""])
Beispiel #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()
Beispiel #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)
Beispiel #8
0
 def test_subject_invalid_type(self):
     """ Test that non-string subject raises exception """
     with self.assertRaises(Exception):
         CourseVal.subject(1234)
Beispiel #9
0
 def test_capacity(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.capacity(1234)
     except Exception:
         self.fail()
Beispiel #10
0
 def test_corequisites_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.corequisites("")
Beispiel #11
0
 def test_restrictions(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.restrictions(["test"])
     except Exception:
         self.fail()
Beispiel #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()
Beispiel #13
0
 def test_corequisites_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.corequisites(1234)
Beispiel #14
0
 def test_name(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.name("test")
     except Exception:
         self.fail()
Beispiel #15
0
 def test_name_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.name(1234)
Beispiel #16
0
 def test_subject_length(self):
     """ Test that zero-length subject raises exception """
     with self.assertRaises(Exception):
         CourseVal.subject("")
Beispiel #17
0
 def test_number(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.number("1234")
     except Exception:
         self.fail()
Beispiel #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)
Beispiel #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)
Beispiel #20
0
 def test_distance_education_invalid_type(self):
     """ Test that invalid type raises exception """
     with self.assertRaises(Exception):
         CourseVal.distance_education(1234)
Beispiel #21
0
 def test_credits(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.credits(0.5)
     except Exception:
         self.fail()
Beispiel #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()
Beispiel #23
0
 def test_departments_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.departments([])
Beispiel #24
0
 def test_description(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.description("test")
     except Exception:
         self.fail()
Beispiel #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")
Beispiel #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": []})
Beispiel #27
0
 def test_subject(self):
     """ Test that valid subject does not raise exception """
     try:
         CourseVal.subject("test")
     except Exception:
         self.fail()
Beispiel #28
0
 def test_departments(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.departments(["test"])
     except Exception:
         self.fail()
Beispiel #29
0
 def test_name_length(self):
     """ Test that zero-length raises exception """
     with self.assertRaises(Exception):
         CourseVal.name("")
Beispiel #30
0
 def test_corequisites(self):
     """ Test that valid args does not raise exception """
     try:
         CourseVal.corequisites("test")
     except Exception:
         self.fail()