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